summaryrefslogtreecommitdiff
path: root/libjava/gnu
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-18 14:07:42 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-18 14:07:42 +0000
commit8adfde8a54ea40ae2cf42010468ac64be35430b6 (patch)
treeeaafd833fc31fd9d7f0d109af91a4ef8d47ae4af /libjava/gnu
parent672c5880ea32e78b8d04a0b5132ba3aeb299b278 (diff)
downloadgcc-8adfde8a54ea40ae2cf42010468ac64be35430b6.tar.gz
2004-10-18 Andrew Haley <aph@redhat.com>
PR java/18036: * gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Reorganize and correct logic used to find interpreter. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89221 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu')
-rw-r--r--libjava/gnu/gcj/runtime/natStackTrace.cc31
1 files changed, 17 insertions, 14 deletions
diff --git a/libjava/gnu/gcj/runtime/natStackTrace.cc b/libjava/gnu/gcj/runtime/natStackTrace.cc
index fbe403a17ef..d9f3355c046 100644
--- a/libjava/gnu/gcj/runtime/natStackTrace.cc
+++ b/libjava/gnu/gcj/runtime/natStackTrace.cc
@@ -65,7 +65,7 @@ gnu::gcj::runtime::StackTrace::fillInStackTrace (jint maxlen, jint offset)
#ifdef INTERPRETER
extern void *const _Jv_StartOfInterpreter;
extern void * _Jv_EndOfInterpreter;
-
+
java::lang::Thread *thread = java::lang::Thread::currentThread();
_Jv_MethodChain *interp_frame
= (thread ? reinterpret_cast<_Jv_MethodChain *> (thread->interp_frame)
@@ -92,20 +92,23 @@ gnu::gcj::runtime::StackTrace::fillInStackTrace (jint maxlen, jint offset)
// less than _Jv_EndOfInterpreter it might be in the
// interpreter: we call _Unwind_FindEnclosingFunction to
// find out.
- if ((_Jv_EndOfInterpreter == NULL || pc < _Jv_EndOfInterpreter)
- && (_Unwind_FindEnclosingFunction (pc)
- == _Jv_StartOfInterpreter))
- {
- frame[n].interp = (void *) interp_frame->self;
- interp_frame = interp_frame->next;
- }
- else
+ if (pc >= _Jv_StartOfInterpreter
+ && (pc < _Jv_EndOfInterpreter
+ || _Jv_EndOfInterpreter == NULL))
{
- // We've found an address that we know is not within
- // the interpreter. We use that to refine our upper
- // bound on where the interpreter ends.
- if (_Jv_EndOfInterpreter == NULL || pc < _Jv_EndOfInterpreter)
- _Jv_EndOfInterpreter = pc;
+ if (_Unwind_FindEnclosingFunction (pc)
+ == _Jv_StartOfInterpreter)
+ {
+ frame[n].interp = (void *) interp_frame->self;
+ interp_frame = interp_frame->next;
+ }
+ else
+ {
+ // We've found an address that we know is not within
+ // the interpreter. We use that to refine our upper
+ // bound on where the interpreter ends.
+ _Jv_EndOfInterpreter = pc;
+ }
}
}
#endif // INTERPRETER