We have a perennial problem in printing subtypes of HashtableEntry in gdb.
This is probably due to a stupid bug in gdb; other debuggers like lldb or vs don't have such an issue.
(gdb) b PlaceholderEntry::next
(gdb) c
Thread 2 "java" hit Breakpoint 2, PlaceholderEntry::next
(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 work around is simple:
-template <MEMFLAGS F> class BasicHashtableEntry : public CHeapObj<F> {
+template <MEMFLAGS F> class BasicHashtableEntry {
There's no need to subclass from CHeapObj since we do all the alloc/free ourselves in BasicHashtable<F>::new_entry(). I.e., we have
// Entry objects should not be created, they should be taken from the
// free list with BasicHashtable.new_entry().
BasicHashtableEntry() { ShouldNotReachHere(); }
// Entry objects should not be destroyed. They should be placed on
// the free list instead with BasicHashtable.free_entry().
~BasicHashtableEntry() { ShouldNotReachHere(); }
This is probably due to a stupid bug in gdb; other debuggers like lldb or vs don't have such an issue.
(gdb) b PlaceholderEntry::next
(gdb) c
Thread 2 "java" hit Breakpoint 2, PlaceholderEntry::next
(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 work around is simple:
-template <MEMFLAGS F> class BasicHashtableEntry : public CHeapObj<F> {
+template <MEMFLAGS F> class BasicHashtableEntry {
There's no need to subclass from CHeapObj since we do all the alloc/free ourselves in BasicHashtable<F>::new_entry(). I.e., we have
// Entry objects should not be created, they should be taken from the
// free list with BasicHashtable.new_entry().
BasicHashtableEntry() { ShouldNotReachHere(); }
// Entry objects should not be destroyed. They should be placed on
// the free list instead with BasicHashtable.free_entry().
~BasicHashtableEntry() { ShouldNotReachHere(); }