(src/vm/jit/m68k/md.c): md_stacktrace_get_returnaddress needs to be exported.
authorRoland Lezuo <tbfg@complang.tuwien.ac.at>
Wed, 13 Feb 2008 22:14:35 +0000 (23:14 +0100)
committerRoland Lezuo <tbfg@complang.tuwien.ac.at>
Wed, 13 Feb 2008 22:14:35 +0000 (23:14 +0100)
(src/vm/jit/m68k/md.h): Likewise.

src/vm/jit/m68k/md.c
src/vm/jit/m68k/md.h

index b9b6e33bff92d044ea401a8cfcf935f44c8524c1..9fb12da0c144ba32773430e615448de7fc377bd5 100644 (file)
@@ -111,6 +111,35 @@ void *md_jit_method_patch_address(void *pv, void *ra, void *mptr)
        return pa;
 }
 
+void *md_stacktrace_get_returnaddress(void *sp, int32_t stackframesize)
+{
+       void *ra;
+
+       /* return address is above stackpointer */
+
+       ra = *((void **) (((uintptr_t) sp) + stackframesize));
+       
+       /* XXX: This helps for now, but it's a ugly hack
+        * the problem _may_ be: the link instruction is used
+        * by some gcc generated code, and we get an additional word
+        * on the stack, the old framepointer. Its address is somewhere
+        * near sp, but that all depends the code generated by the compiler.
+        * I'm unsure about a clean solution.
+        */
+#if 0
+       if (!(ra > 0x40000000 && ra < 0x80000000))      {
+               ra = *((u1**)(sp + framesize + 4));
+       }
+#endif
+
+       /* assert(ra > 0x40000000 && ra < 0x80000000);
+       printf("XXXXXX=%x\n", ra);
+        */
+
+       return ra;
+}
+
+
 
 /*
  * These are local overrides for various environment variables in Emacs.
index de87abbb124ba0fca88d420b5c1bbcb9943a86dd..3ef67014ee853bdb893648fa7af0c4fc9f2e3b49 100644 (file)
 
 *******************************************************************************/
 
-inline static void *md_stacktrace_get_returnaddress(void *sp, int32_t stackframesize)
-{
-       void *ra;
-
-       /* return address is above stackpointer */
-
-       ra = *((void **) (((uintptr_t) sp) + stackframesize));
-       
-       /* XXX: This helps for now, but it's a ugly hack
-        * the problem _may_ be: the link instruction is used
-        * by some gcc generated code, and we get an additional word
-        * on the stack, the old framepointer. Its address is somewhere
-        * near sp, but that all depends the code generated by the compiler.
-        * I'm unsure about a clean solution.
-        */
-#if 0
-       if (!(ra > 0x40000000 && ra < 0x80000000))      {
-               ra = *((u1**)(sp + framesize + 4));
-       }
-#endif
-
-       /* assert(ra > 0x40000000 && ra < 0x80000000);
-       printf("XXXXXX=%x\n", ra);
-        */
-
-       return ra;
-}
+void *md_stacktrace_get_returnaddress(void *sp, int32_t stackframesize);
 
 
 /* md_codegen_get_pv_from_pc ***************************************************