This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Stack traces, etc.


Tom Tromey writes:
 > >>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:
 > 
 > Andrew> Revised, VMThrowable reinstated, testing now.  Checkin
 > Andrew> tomorrow unless anyone complains.
 > 
 > No complaint here.
 > 
 > Andrew> + #ifdef INTERPRETER
 > Andrew> +       extern void _Jv_StartOfInterpreter (void);
 > Andrew> +       extern void _Jv_EndOfInterpreter (void);
 > 
 > Anthony, you once said your stack trace patch used the address of the
 > libffi stub to keep track of interpreted frames.  Can you tell me how
 > to do this?  How do I find the size of the stub?
 > 
 > This seems like a cleaner implementation, provided we get the GC
 > behavior correct.  And it will fix PR 8170 (we need a hack similar to
 > the above for JNI methods).

The Right Way to do it is something like this

  _Jv_frame_info *frame = GET_FRAME (n);
  void *p = _Unwind_FindEnclosingFunction (frame->addr);
  if (p == &interpreterf1 
      || p == &interpreterf2 ...

or, alternatively something like

      _Jv_frame_info *frame = GET_FRAME (n);
      gnu::gcj::runtime::MethodRef *ref 
        = getCompiledMethodRef ((gnu::gcj::RawData *)frame->addr);
      if (ref && ref->klass == &gnu::gcj::interpreter)
        ... it's an interpreter function ...

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]