jvm.h (struct _Jv_frame_info): New structure.
* include/jvm.h (struct _Jv_frame_info): New structure. * gnu/gcj/runtime/natNameFinder.cc: Include StringBuffer.h, java-interp.h. (lookupInterp): New method. (getAddrAsString): Use _Jv_frame_info. (dladdrLookup): Likewise. * gnu/gcj/runtime/NameFinder.java (lookup): Try to look up interpreted frame. (lookupInterp): Declare. * java/lang/natVMThrowable.cc: Include Thread.h, java-interp.h. (fillInStackTrace): Collect information on interpreted frames. Use _Jv_frame_info. * interpret.cc: Include Thread.h. (run): Create and push _Jv_MethodChain object. (_Jv_EndOfInterpreter): New global. * java/lang/Thread.java (interp_frame): New field. * include/java-interp.h (struct _Jv_MethodChain): New structure. Include NameFinder.h. From-SVN: r56657
This commit is contained in:
parent
ce4e997039
commit
3308c46e47
8 changed files with 160 additions and 11 deletions
|
@ -10,6 +10,8 @@ details. */
|
|||
|
||||
package java.lang;
|
||||
|
||||
import gnu.gcj.RawData;
|
||||
|
||||
/**
|
||||
* @author Tom Tromey <tromey@cygnus.com>
|
||||
* @date August 24, 1998
|
||||
|
@ -311,6 +313,9 @@ public class Thread implements Runnable
|
|||
private boolean startable_flag;
|
||||
private ClassLoader context_class_loader;
|
||||
|
||||
// This describes the top-most interpreter frame for this thread.
|
||||
RawData interp_frame;
|
||||
|
||||
// Our native data - points to an instance of struct natThread.
|
||||
private Object data;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ details. */
|
|||
#include <java-threads.h>
|
||||
#include <java/lang/Throwable.h>
|
||||
#include <java/lang/VMThrowable.h>
|
||||
#include <java/lang/Thread.h>
|
||||
#include <java-interp.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
|
@ -54,13 +56,35 @@ java::lang::VMThrowable::fillInStackTrace (java::lang::Throwable* t)
|
|||
// to include the calls to fillInStackTrace in the trace.
|
||||
int n = backtrace (p, 128) - 1;
|
||||
|
||||
void **addrs;
|
||||
_Jv_frame_info *addrs;
|
||||
if (n > 0)
|
||||
{
|
||||
#ifdef INTERPRETER
|
||||
extern void _Jv_StartOfInterpreter (void);
|
||||
extern void _Jv_EndOfInterpreter (void);
|
||||
|
||||
java::lang::Thread *thread = java::lang::Thread::currentThread();
|
||||
_Jv_MethodChain *interp_frame
|
||||
= (thread ? reinterpret_cast<_Jv_MethodChain *> (thread->interp_frame)
|
||||
: NULL);
|
||||
#endif // INTERPRETER
|
||||
|
||||
state->length = n;
|
||||
addrs = (void **) _Jv_Malloc (n * sizeof p[0]);
|
||||
int len = n;
|
||||
addrs = (_Jv_frame_info *) _Jv_Malloc (n * sizeof (_Jv_frame_info));
|
||||
while (n--)
|
||||
addrs[n] = p[n];
|
||||
{
|
||||
addrs[n].addr = p[n];
|
||||
#ifdef INTERPRETER
|
||||
if (p[n] >= &_Jv_StartOfInterpreter && p[n] <= &_Jv_EndOfInterpreter)
|
||||
{
|
||||
addrs[n].interp = (void *) interp_frame->self;
|
||||
interp_frame = interp_frame->next;
|
||||
}
|
||||
else
|
||||
addrs[n].interp = 0;
|
||||
#endif // INTERPRETER
|
||||
}
|
||||
}
|
||||
else
|
||||
addrs = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue