Commit 896b1c87 by Keith Seitz Committed by Keith Seitz

java-interp.h (_Jv_Frame::depth): New function.

        * include/java-interp.h (_Jv_Frame::depth):
        New function.
        * jvmti.cc (_Jv_JVMTI_GetFrameCount): Use _Jv_Frame::depth.

From-SVN: r121709
parent 1f64a081
2007-02-07 Keith Seitz <keiths@redhat.com>
* include/java-interp.h (_Jv_Frame::depth):
New function.
* jvmti.cc (_Jv_JVMTI_GetFrameCount): Use _Jv_Frame::depth.
2007-02-07 Kyle Galloway <kgallowa@redhat.com> 2007-02-07 Kyle Galloway <kgallowa@redhat.com>
* jvmti.cc (CHECK_FOR_NATIVE_METHOD): New macro. * jvmti.cc (CHECK_FOR_NATIVE_METHOD): New macro.
......
// java-interp.h - Header file for the bytecode interpreter. -*- c++ -*- // java-interp.h - Header file for the bytecode interpreter. -*- c++ -*-
/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation /* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
This file is part of libgcj. This file is part of libgcj.
...@@ -357,6 +357,16 @@ public: ...@@ -357,6 +357,16 @@ public:
{ {
thread->frame = (gnu::gcj::RawData *) next; thread->frame = (gnu::gcj::RawData *) next;
} }
int depth ()
{
int depth = 0;
struct _Jv_Frame *f;
for (f = this; f != NULL; f = f->next)
++depth;
return depth;
}
}; };
// An interpreted frame in the call stack // An interpreted frame in the call stack
......
...@@ -271,14 +271,7 @@ _Jv_JVMTI_GetFrameCount (MAYBE_UNUSED jvmtiEnv *env, jthread thread, ...@@ -271,14 +271,7 @@ _Jv_JVMTI_GetFrameCount (MAYBE_UNUSED jvmtiEnv *env, jthread thread,
THREAD_CHECK_IS_ALIVE (thr); THREAD_CHECK_IS_ALIVE (thr);
_Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thr->frame); _Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thr->frame);
(*frame_count) = 0; (*frame_count) = frame->depth ();
while (frame != NULL)
{
(*frame_count)++;
frame = frame->next;
}
return JVMTI_ERROR_NONE; return JVMTI_ERROR_NONE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment