RFR: 8263834: Work around gdb <incomplete type> for HashtableEntry

Coleen Phillimore coleenp at openjdk.java.net
Fri Mar 19 13:41:55 UTC 2021


On Fri, 19 Mar 2021 03:20:21 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> Please review this one liner to work around a gdb bug in printing subtypes of `HashtableEntry`:
> 
> (gdb) p this
> $1 = (const PlaceholderEntry * const) 0x7ffff0242a30
> (gdb) p *this
> $2 = <incomplete type>
> (gdb) ptype this
> type = const class PlaceholderEntry {
>     <incomplete type>
> } * const
> 
> The fix is to no longer subclass `HashtableEntry` from `CHeapObj`. Apparently that makes gdb happy. None of our code requires this subclass relationship.
> 
> Tested with tiers 1-4.

I think this is fine and appreciated.  I have removed the block allocation but now use placement new, so the constructors are called (vptr won't be 0xf1f1 etc), but that works fine with this change.  For some reason, using normal new HashtableEntry<>() crashes malloc so I can't really do that anyway.

-------------

Marked as reviewed by coleenp (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3084


More information about the hotspot-dev mailing list