* md_stacktrace_get_returnaddress: added
authortwisti <none@none>
Tue, 5 Jul 2005 13:39:44 +0000 (13:39 +0000)
committertwisti <none@none>
Tue, 5 Jul 2005 13:39:44 +0000 (13:39 +0000)
src/vm/jit/stacktrace.h
src/vm/jit/x86_64/md.c

index c5c0bddbee1ca8dba5771706d409a3000cb987ad..8440bda4ae1cf696d8e5b039c47a46ceb5680882 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: stacktrace.h 2799 2005-06-23 09:54:26Z twisti $
+   $Id: stacktrace.h 2914 2005-07-05 13:39:44Z twisti $
 
 */
 
@@ -95,6 +95,9 @@ methodinfo* cacao_callingMethod(void);
 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 */
 
 
index 4aea32aad1159717ee549bd027faba10d622804d..a1ee444741c186bdf0e792d79def0b2b3343a0c1 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: md.c 2840 2005-06-27 12:07:54Z twisti $
+   $Id: md.c 2914 2005-07-05 13:39:44Z twisti $
 
 */
 
@@ -111,6 +111,25 @@ void thread_restartcriticalsection(ucontext_t *uc)
 #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