Changes:
- $Id: stacktrace.h 2799 2005-06-23 09:54:26Z twisti $
+ $Id: stacktrace.h 2914 2005-07-05 13:39:44Z twisti $
*/
java_objectarray *cacao_getStackForVMAccessController(void);
void stacktrace_dump_trace(void);
+/* machine dependent functions (code in ARCH_DIR/md.c) */
+functionptr md_stacktrace_get_returnaddress(u1 *sp, u4 framesize);
+
#endif /* _STACKTRACE_H */
Changes:
- $Id: md.c 2840 2005-06-27 12:07:54Z twisti $
+ $Id: md.c 2914 2005-07-05 13:39:44Z twisti $
*/
#endif
+/* md_stacktrace_get_returnaddress *********************************************
+
+ Returns the return address of the current stackframe, specified by
+ the passed stack pointer and the stack frame size.
+
+*******************************************************************************/
+
+functionptr md_stacktrace_get_returnaddress(u1 *sp, u4 framesize)
+{
+ functionptr ra;
+
+ /* on x86_64 the return address is above the current stack frame */
+
+ ra = (functionptr) *((u1 **) (sp + framesize));
+
+ return ra;
+}
+
+
/*
* These are local overrides for various environment variables in Emacs.
* Please do not remove this and leave it at the end of the file, where