summaryrefslogtreecommitdiff
path: root/libjava/interpret.cc
diff options
context:
space:
mode:
authorkgallowa <kgallowa@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-15 15:08:27 +0000
committerkgallowa <kgallowa@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-15 15:08:27 +0000
commitfe862dbf491fb9fa09b3581b6151b434835b7e1d (patch)
treed582917d66a2280e29d258af271b3d5500823c60 /libjava/interpret.cc
parent35c2394dee3a6c7094cfc7d3fecb7dd0bddac894 (diff)
downloadgcc-fe862dbf491fb9fa09b3581b6151b434835b7e1d.tar.gz
2007-02-15 Kyle Galloway <kgallowa@redhat.com>
* defineclass.cc (_Jv_ClassReader::read_one_code_attribute): Added LocalVariableTable attribute handling. (_Jv_ClassReader::pool_Utf8_to_char_arr): New method. * jvmti.cc (_Jv_JVMTI_GetLocalVariableTable): New method. * include/java-interp.h: Added local_var_table and local_var_table_len fields to _Jv_InterpMethod. (_Jv_InterpMethod::get_local_var_table): New method. * testsuite/libjava.jvmti/interp/getlocalvartable.java: New test. * testsuite/libjava.jvmti/interp/getlocalvartable.jar: New test. * testsuite/libjava.jvmti/interp/getlocalvartable.out: Output for new test. * testsuite/libjava.jvmti/interp/getlocalvartable.h: New test. * testsuite/libjava.jvmti/interp/natgetlocalvartable.cc: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121999 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r--libjava/interpret.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index 7e7d36d4e01..8a4edace594 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -1414,6 +1414,30 @@ _Jv_InterpMethod::get_line_table (jlong& start, jlong& end,
#endif // !DIRECT_THREADED
}
+int
+_Jv_InterpMethod::get_local_var_table (char **name, char **sig,
+ char **generic_sig, jlong *startloc,
+ jint *length, jint *slot,
+ int table_slot)
+{
+ if (local_var_table == NULL)
+ return -2;
+ if (table_slot >= local_var_table_len)
+ return -1;
+ else
+ {
+ *name = local_var_table[table_slot].name;
+ *sig = local_var_table[table_slot].descriptor;
+ *generic_sig = local_var_table[table_slot].descriptor;
+
+ *startloc = static_cast<jlong>
+ (local_var_table[table_slot].bytecode_start_pc);
+ *length = static_cast<jint> (local_var_table[table_slot].length);
+ *slot = static_cast<jint> (local_var_table[table_slot].slot);
+ }
+ return local_var_table_len - table_slot -1;
+}
+
pc_t
_Jv_InterpMethod::install_break (jlong index)
{