@@ -141,7 +141,7 @@ def get_uncompressed_type(cls, t: gdb.Type) -> gdb.Type:
141141 # compressed types only exist for java type which are either struct or union
142142 if t .code != gdb .TYPE_CODE_STRUCT and t .code != gdb .TYPE_CODE_UNION :
143143 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
145145 trace (f'<SVMUtil> - get_uncompressed_type({ t } ) = { result } ' )
146146 return result
147147
@@ -177,7 +177,7 @@ def get_compressed_oop(cls, obj: gdb.Value) -> int:
177177 # recreate compressed oop from the object address
178178 # this reverses the uncompress expression from
179179 # 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
181181 compression_shift = cls .compression_shift
182182 num_reserved_bits = int .bit_count (cls .reserved_bits_mask )
183183 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:
205205
206206 @classmethod
207207 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+
208213 type_name = cls .get_basic_type (t ).name
209214 if type_name is None :
210215 # fallback to the GDB type printer for t
@@ -363,6 +368,9 @@ def get_classloader_namespace(cls, obj: gdb.Value) -> str:
363368 def get_rtt (cls , obj : gdb .Value ) -> gdb .Type :
364369 static_type = cls .get_basic_type (obj .type )
365370
371+ if static_type == cls .hub_type :
372+ return cls .hub_type
373+
366374 # check for interfaces and cast them to Object to make the hub accessible
367375 if cls .get_uncompressed_type (cls .get_basic_type (obj .type )).code == gdb .TYPE_CODE_UNION :
368376 obj = cls .cast_to (obj , cls .object_type )
0 commit comments