gdb/memdump: show prev and next node in address finding mode

This will make it easier to debug memory corruption when agacent node is corrupted.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
xuxingliang 2024-11-13 16:10:24 +08:00 committed by Xiang Xiao
parent dd7203aff7
commit 797f7a043d

View file

@ -240,7 +240,11 @@ class MMDump(gdb.Command):
if node or (node := self.find(heaps, addr)):
printnode(node, 1)
source = "Pool" if node.from_pool else "Heap"
print(f"{addr: #x} found belongs to {source}, node@{node.address:#x}")
print(f"{addr: #x} found belongs to {source} {node}")
if node.prevnode:
print(f"prevnode: {node.prevnode}")
if node.nextnode:
print(f"nextnode: {node.nextnode}")
else:
print(f"Address {addr:#x} not found in any heap")
return