@@ -141,7 +141,7 @@ def get_uncompressed_type(cls, t: gdb.Type) -> gdb.Type:
141
141
# compressed types only exist for java type which are either struct or union
142
142
if t .code != gdb .TYPE_CODE_STRUCT and t .code != gdb .TYPE_CODE_UNION :
143
143
return t
144
- result = cls .get_base_class (t ) if cls .is_compressed (t ) else t
144
+ result = cls .get_base_class (t ) if ( cls .is_compressed (t ) and t != cls . hub_type ) else t
145
145
trace (f'<SVMUtil> - get_uncompressed_type({ t } ) = { result } ' )
146
146
return result
147
147
@@ -177,7 +177,7 @@ def get_compressed_oop(cls, obj: gdb.Value) -> int:
177
177
# recreate compressed oop from the object address
178
178
# this reverses the uncompress expression from
179
179
# com.oracle.objectfile.elf.dwarf.DwarfInfoSectionImpl#writeIndirectOopConversionExpression
180
- is_hub = cls .get_rtt (obj ) == cls .hub_type
180
+ is_hub = cls .get_basic_type (obj . type ) == cls .hub_type
181
181
compression_shift = cls .compression_shift
182
182
num_reserved_bits = int .bit_count (cls .reserved_bits_mask )
183
183
num_alignment_bits = int .bit_count (cls .object_alignment - 1 )
@@ -205,6 +205,11 @@ def get_unqualified_type_name(cls, qualified_type_name: str) -> str:
205
205
206
206
@classmethod
207
207
def is_compressed (cls , t : gdb .Type ) -> bool :
208
+ # for the hub type we always want handle it as compressed as there is no clear distinction in debug info for
209
+ # the hub field, and it may always have an expression in the type's data_location attribute
210
+ if cls .get_basic_type (t ) == cls .hub_type :
211
+ return True
212
+
208
213
type_name = cls .get_basic_type (t ).name
209
214
if type_name is None :
210
215
# fallback to the GDB type printer for t
@@ -363,6 +368,9 @@ def get_classloader_namespace(cls, obj: gdb.Value) -> str:
363
368
def get_rtt (cls , obj : gdb .Value ) -> gdb .Type :
364
369
static_type = cls .get_basic_type (obj .type )
365
370
371
+ if static_type == cls .hub_type :
372
+ return cls .hub_type
373
+
366
374
# check for interfaces and cast them to Object to make the hub accessible
367
375
if cls .get_uncompressed_type (cls .get_basic_type (obj .type )).code == gdb .TYPE_CODE_UNION :
368
376
obj = cls .cast_to (obj , cls .object_type )
0 commit comments