SVN: backtracexx/backtracexx.cpp

pluto pluto at pld-linux.org
Wed Jul 11 15:19:14 CEST 2007


Author: pluto
Date: Wed Jul 11 15:19:14 2007
New Revision: 8670

Modified:
   backtracexx/backtracexx.cpp
Log:
- adjust caller address on windows too. 


Modified: backtracexx/backtracexx.cpp
==============================================================================
--- backtracexx/backtracexx.cpp	(original)
+++ backtracexx/backtracexx.cpp	Wed Jul 11 15:19:14 2007
@@ -5,6 +5,7 @@
 #include <dlfcn.h>
 #include <unwind.h>
 #elif defined( _MSC_VER )
+#pragma warning( disable : 4312 )	//	'reinterpret_cast' : conversion from 'unsigned long' to 'void*' of greater size
 #include <windows.h>
 #include <dbghelp.h>
 //
@@ -40,7 +41,7 @@
 			ip -= 8;
 #elif defined( __alpha__ )
 			ip -= 4;
-#elif defined( __i386__ ) || defined( __x86_64__ )
+#elif defined( __i386__ ) || defined( __x86_64__ ) || defined( WIN32 )
 			//
 			//	TODO:
 			//		analysis of complex addressing forms (see intel/24319102.pdf).
@@ -106,8 +107,6 @@
 
 #elif defined( _MSC_VER ) && defined( WIN32 )
 
-#pragma warning( disable : 4312 )	//	'reinterpret_cast' : conversion from 'unsigned long' to 'LPCVOID' of greater size
-
 		void lookupSymbol( Frame& frame )
 		{
 			::MEMORY_BASIC_INFORMATION mbi;
@@ -178,7 +177,7 @@
 		while ( stackFrame->returnAddress )
 		{
 			Frame frame;
-			frame.address = stackFrame->returnAddress;
+			frame.address = caller( stackFrame->returnAddress );
 			lookupSymbol( frame );
 			trace.push_back( frame );
 			stackFrame = stackFrame->previousFrame;


More information about the pld-cvs-commit mailing list