mirror of git://gcc.gnu.org/git/gcc.git
stacktrace.cc (UnwindTraceFn): Use UNWRAP_FUNCTION_DESCRIPTOR to compare _Jv_InterpMethod::run against current...
* stacktrace.cc (UnwindTraceFn): Use UNWRAP_FUNCTION_DESCRIPTOR to compare _Jv_InterpMethod::run against current func. From-SVN: r107746
This commit is contained in:
parent
16ab8e74da
commit
9cc20fa152
|
|
@ -1,3 +1,8 @@
|
||||||
|
2005-12-01 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* stacktrace.cc (UnwindTraceFn): Use UNWRAP_FUNCTION_DESCRIPTOR
|
||||||
|
to compare _Jv_InterpMethod::run against current func.
|
||||||
|
|
||||||
2005-11-30 Andrew Haley <aph@redhat.com>
|
2005-11-30 Andrew Haley <aph@redhat.com>
|
||||||
|
|
||||||
* classpath/lib/Makefile.am (resources): Use `cp -p'.
|
* classpath/lib/Makefile.am (resources): Use `cp -p'.
|
||||||
|
|
|
||||||
|
|
@ -108,16 +108,17 @@ _Jv_StackTrace::UnwindTraceFn (struct _Unwind_Context *context, void *state_ptr)
|
||||||
state->frames = (_Jv_StackFrame *) newFrames;
|
state->frames = (_Jv_StackFrame *) newFrames;
|
||||||
state->length = newLength;
|
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
|
// 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
|
// 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
|
// the java code and not the interpreter itself. This assumes a 1:1
|
||||||
// correspondance between call frames in the interpreted stack and occurances
|
// correspondance between call frames in the interpreted stack and occurances
|
||||||
// of _Jv_InterpMethod::run() on the native stack.
|
// of _Jv_InterpMethod::run() on the native stack.
|
||||||
#ifdef INTERPRETER
|
#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].type = frame_interpreter;
|
||||||
state->frames[pos].interp.meth = state->interp_frame->self;
|
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].type = frame_native;
|
||||||
state->frames[pos].ip = (void *) _Unwind_GetIP (context);
|
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));
|
//printf ("unwind ip: %p\n", _Unwind_GetIP (context));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue