Inspecting the Heap with pwndbg
$ gdb ./vuln
pwndbg> break main
pwndbg> run
pwndbg> heap # list all chunks in the arena
pwndbg> bins # show tcache / fastbins / unsorted / small / large
pwndbg> vis_heap_chunks # colorized visual dump of chunks + metadata
pwndbg> tcache # inspect the per-thread cache directly
heapwalks the chunk list: address, size, flags.binstells you which free list a chunk landed in after afree— essential for planning reuse.vis_heap_chunksdrawsfd/nextpointers so you can see poisoning take effect.
Key Takeaway
Do not guess the heap layout — watch it. Free something, then re-run bins and vis_heap_chunks to confirm.