diff options
author | kseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-02 17:01:01 +0000 |
---|---|---|
committer | kseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-02 17:01:01 +0000 |
commit | 94993257623f2c3e7961ba18dc7ea95d96a88abd (patch) | |
tree | c873400782a835ca01b0875ee3b7622f21122be8 | |
parent | c83167c404730d8f9b2a6b9963800ff9e3e62baf (diff) | |
download | gcc-94993257623f2c3e7961ba18dc7ea95d96a88abd.tar.gz |
* gnu/classpath/jdwp/natVMMethod.cc (getLineTable): Implement.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118420 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libjava/ChangeLog | 4 | ||||
-rw-r--r-- | libjava/gnu/classpath/jdwp/natVMMethod.cc | 40 |
2 files changed, 42 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index e8348a0a909..cdbf3da458a 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,9 @@ 2006-11-02 Keith Seitz <keiths@redhat.com> + * gnu/classpath/jdwp/natVMMethod.cc (getLineTable): Implement. + +2006-11-02 Keith Seitz <keiths@redhat.com> + * jvmti.cc (_Jv_JVMTI_GetLineNumberTable): New function. (_Jv_JVMTI_Interface): Define GetLineNumberTable. diff --git a/libjava/gnu/classpath/jdwp/natVMMethod.cc b/libjava/gnu/classpath/jdwp/natVMMethod.cc index eb1d6fda0c2..7dea4747731 100644 --- a/libjava/gnu/classpath/jdwp/natVMMethod.cc +++ b/libjava/gnu/classpath/jdwp/natVMMethod.cc @@ -10,8 +10,10 @@ details. */ #include <config.h> #include <gcj/cni.h> +#include <java-interp.h> #include <gnu/classpath/jdwp/VMMethod.h> +#include <gnu/classpath/jdwp/exception/JdwpInternalErrorException.h> #include <gnu/classpath/jdwp/util/LineTable.h> #include <gnu/classpath/jdwp/util/VariableTable.h> @@ -33,10 +35,44 @@ gnu::classpath::jdwp::VMMethod::getModifiers () return 0; } -gnu::classpath::jdwp::util::LineTable* +gnu::classpath::jdwp::util::LineTable * gnu::classpath::jdwp::VMMethod::getLineTable () { - return NULL; + if (!_Jv_IsInterpretedClass (getDeclaringClass ())) + { + // this should not happen + ::java::lang::String *msg = JvNewStringLatin1 ("native class"); + throw new exception::JdwpInternalErrorException (msg); + } + + jmethodID desired_method = reinterpret_cast<jmethodID> (_methodId); + + _Jv_MethodBase *theMethod + = _Jv_FindInterpreterMethod (getDeclaringClass (), desired_method); + + if (theMethod == NULL) + { + // this should not happen + ::java::lang::String *msg + = JvNewStringLatin1 ("could not find method in class"); + throw new exception::JdwpInternalErrorException (msg); + } + + if (::java::lang::reflect::Modifier::isNative (desired_method->accflags)) + { + jintArray lines = JvNewIntArray (0); + jlongArray indices = JvNewLongArray (0); + return new util::LineTable (-1, -1, lines, indices); + } + + // get the linetable + _Jv_InterpMethod *imeth = reinterpret_cast<_Jv_InterpMethod *> (theMethod); + jlong start; + jlong end; + jintArray lines; + jlongArray indices; + imeth->get_line_table (start, end, lines, indices); + return new util::LineTable (start, end, lines, indices); } |