debug/gocore: handle 1.11 sparse heaps

Go 1.11 changed (will change?) the Go heap.  Instead of a single
arena, there will be potentially multiple arenas.

Change the way we do address->object lookups to handle multiple,
not necessarily near each other, arenas.  The major change is to
Use a page table instead of an array to keep HeapInfo structures.

Also move ptr/nonptr bits into HeapInfo, as they are recorded
differently in 1.11.  It's a bit tricky because a heapInfo needs
different numbers of ptr/nonptr bits for 32 and 64 bit inferiors.

I'll add a 1.11 test when 1.11 ships. A tip-compiled test passes
with this CL, but I don't want to check that in.

Change-Id: I5b32fc4aaa88db137a23df2b4592eaba8a3f1fcc
Reviewed-by: Austin Clements <>
9 files changed