summaryrefslogtreecommitdiffstats
path: root/libjava/stacktrace.cc
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-30 23:58:16 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-30 23:58:16 +0000
commit620414a1425ed46a2722bbe9289aee2a0117c41f (patch)
treeeb9d2a9f01aeb3756c4ee2163b8aca1963e5a742 /libjava/stacktrace.cc
parent8301615623327972c6ad5dd1b14ec3d959381d4f (diff)
downloadppe42-gcc-620414a1425ed46a2722bbe9289aee2a0117c41f.tar.gz
ppe42-gcc-620414a1425ed46a2722bbe9289aee2a0117c41f.zip
* stacktrace.cc (UnwindTraceFn): Use UNWRAP_FUNCTION_DESCRIPTOR
to compare _Jv_InterpMethod::run against current func. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107746 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/stacktrace.cc')
-rw-r--r--libjava/stacktrace.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/libjava/stacktrace.cc b/libjava/stacktrace.cc
index bc1935f1a75..1bdabdfbd59 100644
--- a/libjava/stacktrace.cc
+++ b/libjava/stacktrace.cc
@@ -108,16 +108,17 @@ _Jv_StackTrace::UnwindTraceFn (struct _Unwind_Context *context, void *state_ptr)
state->frames = (_Jv_StackFrame *) newFrames;
state->length = newLength;
}
-
- _Unwind_Ptr func_addr = _Unwind_GetRegionStart (context);
-
+
+ void *func_addr = (void *) _Unwind_GetRegionStart (context);
+
// If we see the interpreter's main function, "pop" an entry off the
// interpreter stack and use that instead, so that the trace goes through
// the java code and not the interpreter itself. This assumes a 1:1
// correspondance between call frames in the interpreted stack and occurances
// of _Jv_InterpMethod::run() on the native stack.
#ifdef INTERPRETER
- if ((void (*)(void)) func_addr == (void (*)(void)) &_Jv_InterpMethod::run)
+ void *interp_run = (void *) &_Jv_InterpMethod::run;
+ if (func_addr == UNWRAP_FUNCTION_DESCRIPTOR (interp_run))
{
state->frames[pos].type = frame_interpreter;
state->frames[pos].interp.meth = state->interp_frame->self;
@@ -129,7 +130,7 @@ _Jv_StackTrace::UnwindTraceFn (struct _Unwind_Context *context, void *state_ptr)
{
state->frames[pos].type = frame_native;
state->frames[pos].ip = (void *) _Unwind_GetIP (context);
- state->frames[pos].start_ip = (void *) func_addr;
+ state->frames[pos].start_ip = func_addr;
}
//printf ("unwind ip: %p\n", _Unwind_GetIP (context));
OpenPOWER on IntegriCloud