diff options
author | Kyle Galloway <kgallowa@redhat.com> | 2007-02-15 15:08:27 +0000 |
---|---|---|
committer | Kyle Galloway <kgallowa@gcc.gnu.org> | 2007-02-15 15:08:27 +0000 |
commit | fe60528edc81e6aaccb5b49b7108853f30ea6278 (patch) | |
tree | d582917d66a2280e29d258af271b3d5500823c60 /libjava/include | |
parent | ed765125f2981bc0c2976b5650ba54abc3cb5f2e (diff) | |
download | gcc-fe60528edc81e6aaccb5b49b7108853f30ea6278.zip gcc-fe60528edc81e6aaccb5b49b7108853f30ea6278.tar.gz gcc-fe60528edc81e6aaccb5b49b7108853f30ea6278.tar.bz2 |
defineclass.cc (_Jv_ClassReader::read_one_code_attribute): Added LocalVariableTable attribute handling.
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.
From-SVN: r121999
Diffstat (limited to 'libjava/include')
-rw-r--r-- | libjava/include/java-interp.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libjava/include/java-interp.h b/libjava/include/java-interp.h index 2b3ae7c..40c3b281 100644 --- a/libjava/include/java-interp.h +++ b/libjava/include/java-interp.h @@ -137,6 +137,21 @@ struct _Jv_LineTableEntry int line; }; +// This structure holds local variable information. +// The pc value is the first pc where the variable must have a value and it +// must continue to have a value until (start_pc + length). +// The name is the variable name, and the descriptor contains type information. +// The slot is the index in the local variable array of this method, long and +// double occupy slot and slot+1. +struct _Jv_LocalVarTableEntry +{ + int bytecode_start_pc; + int length; + char *name; + char *descriptor; + int slot; +}; + class _Jv_InterpMethod : public _Jv_MethodBase { // Breakpoint instruction @@ -157,6 +172,10 @@ class _Jv_InterpMethod : public _Jv_MethodBase // Length of the line_table - when this is zero then line_table is NULL. int line_table_len; _Jv_LineTableEntry *line_table; + + // The local variable table length and the table itself + int local_var_table_len; + _Jv_LocalVarTableEntry *local_var_table; pc_t prepared; int number_insn_slots; @@ -224,6 +243,20 @@ class _Jv_InterpMethod : public _Jv_MethodBase { return static_cast<int> (max_locals); } + + /* Get info for a local variable of this method. + * If there is no loca_var_table for this method it will return -1. + * table_slot indicates which slot in the local_var_table to get, if there is + * no variable at this location it will return 0. + * Otherwise, it will return the number of table slots after the selected + * slot, indexed from 0. + * + * Example: there are 5 slots in the table, you request slot 0 so it will + * return 4. + */ + int get_local_var_table (char **name, char **sig, char **generic_sig, + jlong *startloc, jint *length, jint *slot, + int table_slot); /* Installs a break instruction at the given code index. Returns the pc_t of the breakpoint or NULL if index is invalid. */ |