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
This commit is contained in:
Keith Seitz 2007-02-08 01:55:29 +00:00 committed by Keith Seitz
parent 1f64a0811b
commit 896b1c8792
3 changed files with 18 additions and 9 deletions

View File

@ -1,3 +1,9 @@
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>
* jvmti.cc (CHECK_FOR_NATIVE_METHOD): New macro.

View File

@ -1,6 +1,6 @@
// 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.
@ -357,6 +357,16 @@ public:
{
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

View File

@ -271,14 +271,7 @@ _Jv_JVMTI_GetFrameCount (MAYBE_UNUSED jvmtiEnv *env, jthread thread,
THREAD_CHECK_IS_ALIVE (thr);
_Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thr->frame);
(*frame_count) = 0;
while (frame != NULL)
{
(*frame_count)++;
frame = frame->next;
}
(*frame_count) = frame->depth ();
return JVMTI_ERROR_NONE;
}