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.
*******************************************************************************/
-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 ***************************************************