diff options
author | Per Bothner <per@bothner.com> | 1997-08-05 21:59:56 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1997-08-05 21:59:56 +0000 |
commit | d2e131a198a957499a8d318f8962f4fe75a2b325 (patch) | |
tree | 7932e33f4dd678fe27e67fd0ac87e257524e6cb9 /gdb/jv-lang.c | |
parent | f7f37388dc1d7910711f89b1c6b4f3808533ff2d (diff) | |
download | gdb-d2e131a198a957499a8d318f8962f4fe75a2b325.zip gdb-d2e131a198a957499a8d318f8962f4fe75a2b325.tar.gz gdb-d2e131a198a957499a8d318f8962f4fe75a2b325.tar.bz2 |
* jv-lang.c (get_java_utf8_name): Re-write so it works with
implied (missing) data field, as defined by cc1java.
(java_link_class_type): Type length and field offset (in interior)
now includes object header. Get static fields working.
* jv-lang.h (JAVA_OBJECT_SIZE): Update for change in Kaffe.
* jv-typeprint.c (java_type_print_derivation_info,
java_type_print_base): New functions, for better Java output.
* jv-valprint.c: Start to support Java-specific output.
Diffstat (limited to 'gdb/jv-lang.c')
-rw-r--r-- | gdb/jv-lang.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index 2e722f8..22a810a 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -197,14 +197,15 @@ get_java_utf8_name (obstack, name) { char *chrs; value_ptr temp = name; - int name_length = (int) value_as_long - (value_struct_elt (&temp, NULL, "length", NULL, "structure")); - temp = name; - temp = value_struct_elt (&temp, NULL, "data", NULL, "structure"); + int name_length; + CORE_ADDR data_addr; + temp = value_struct_elt (&temp, NULL, "length", NULL, "structure"); + name_length = (int) value_as_long (temp); + data_addr = VALUE_ADDRESS (temp) + VALUE_OFFSET (temp) + + TYPE_LENGTH (VALUE_TYPE (temp)); chrs = obstack_alloc (obstack, name_length+1); chrs [name_length] = '\0'; - read_memory_section (VALUE_ADDRESS (temp) + VALUE_OFFSET (temp), - chrs, name_length, NULL); + read_memory_section (data_addr, chrs, name_length, NULL); return chrs; } @@ -378,7 +379,7 @@ java_link_class_type (type, clas) temp = clas; temp = value_struct_elt (&temp, NULL, "bfsize", NULL, "structure"); - TYPE_LENGTH (type) = JAVA_OBJECT_SIZE + value_as_long (temp); + TYPE_LENGTH (type) = value_as_long (temp); fields = NULL; for (i = TYPE_N_BASECLASSES (type); i < nfields; i++) @@ -403,6 +404,8 @@ java_link_class_type (type, clas) temp = field; accflags = value_as_long (value_struct_elt (&temp, NULL, "accflags", NULL, "structure")); + temp = field; + temp = value_struct_elt (&temp, NULL, "info", NULL, "structure"); boffset = value_as_long (value_struct_elt (&temp, NULL, "boffset", NULL, "structure")); if (accflags & 0x0001) /* public access */ @@ -418,13 +421,9 @@ java_link_class_type (type, clas) SET_TYPE_FIELD_PROTECTED (type, i); } if (accflags & 0x0008) /* ACC_STATIC */ - { - TYPE_FIELD_BITPOS (type, i) = -1; - /* Hack for TYPE_FIELD_STATIC_PHYSNAME to prevent a crash. FIXME. */ - type->fields[i].bitsize = (long) "???"; - } + SET_FIELD_PHYSADDR(TYPE_FIELD(type, i), boffset); else - TYPE_FIELD_BITPOS (type, i) = 8 * (JAVA_OBJECT_SIZE + boffset); + TYPE_FIELD_BITPOS (type, i) = 8 * boffset; if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */ { TYPE_FIELD_TYPE (type, i) = get_java_object_type (); /* FIXME */ |