SVN: backtracexx/backtracexx.cpp

pluto pluto at pld-linux.org
Thu Mar 12 10:51:51 CET 2009


Author: pluto
Date: Thu Mar 12 10:51:51 2009
New Revision: 10207

Modified:
   backtracexx/backtracexx.cpp
Log:
- stackframe setup fix.

Modified: backtracexx/backtracexx.cpp
==============================================================================
--- backtracexx/backtracexx.cpp	(original)
+++ backtracexx/backtracexx.cpp	Thu Mar 12 10:51:51 2009
@@ -207,10 +207,22 @@
 				mov context.Ebp, ebp;
 			}
 #else
-#error "win64 needs external assembly."
+#error "msvc/win64 needs external assembly."
 #endif
 #else
-#error "win32/64 gcc implementation not finished yet."
+#if defined( __MINGW64__ )
+			asm ( "foo: movq $foo, %0" : "=g" ( context.Rip ) );
+			register ::DWORD64 rsp asm( "rsp" );
+			context.Rsp = rsp;
+			register ::DWORD64 rbp asm( "rbp" );
+			context.Rbp = rbp;
+#else
+			asm ( "foo: movl $foo, %0" : "=g" ( context.Eip ) );
+			register ::DWORD esp asm( "esp" );
+			context.Esp = esp;
+			register ::DWORD ebp asm( "ebp" );
+			context.Ebp = ebp;
+#endif
 #endif
 
 		}


More information about the pld-cvs-commit mailing list