[RFA/JVMTI] Implement GetLocalVariableTable and GetMaxLocals

Kyle Galloway kgallowa@redhat.com
Wed Feb 14 15:34:00 GMT 2007


Keith Seitz wrote:
> Keith Seitz wrote:
>
>>  > Kyle> +  int get_local_var_table (char **name, char **sig, char 
>> **generic_sig,
>>  > Kyle> +                           long *startloc, jint *length, 
>> jint *slot,
>>  > Kyle> +                           int table_slot)
>>  > Kyle> +        *name = reinterpret_cast<char *>
>>  > Kyle> +          (_Jv_AllocBytes (strlen 
>> (local_var_table[table_slot].name) + 1));
>
> Of course, your original concern about the use of _Jv_AllocBytes is 
> still warranted: It should be using _Jv_MallocUnchecked, just like 
> _Jv_JVMTI_Allocate.
>
> I was simply responding to your original question about how the memory 
> gets released. I apologize for any confusion.
So, what I have done is to change things a bit.  get_local_var_table now 
just sets the pointers to point to the strings stored in 
_Jv_InterpMethod.  in the JVMTI call, we allocate buffers of the correct 
size, then strcpy the strings over into the JVMTI structure.  I think 
this addresses all the concers.

Any other issues?

- Kyle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getlocalvartable.patch
Type: text/x-patch
Size: 16576 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20070214/9ed01b9b/attachment.bin>


More information about the Java-patches mailing list