Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
give up on cross-compiling backtrace code from gcc: inline assembly code cannot be...
[simgrid.git] / src / xbt / backtrace_windows.c
index 6ff8b59..3845ae3 100644 (file)
@@ -200,13 +200,13 @@ int backtrace(void **buffer, int size)
 
   /* ebp points on stack base */
   /* esp points on stack pointer, ie on last stacked element (current element) */
-//  asm ("call $ + 5"); FIXME: this does not works when cross-compiling. Is this really mandatory?
-  asm ("pop %eax");
-  asm ("mov context.Eip, %eax");
-  asm ("mov %eax, %esp");
-  asm ("mov context.Esp, %eax");
-  asm ("mov context.Ebp, %ebp");
-
+  _asm call $ + 5
+  _asm pop %eax
+  _asm mov context.Eip, %eax
+  _asm mov %eax, %esp
+  _asm mov context.Esp, %eax
+  _asm mov context.Ebp, %ebp
+     
   if ((NULL == hlp_dbg_instance) || (size <= 0) || (NULL == buffer)) {
     errno = EINVAL;
     return 0;