From 5a323b4967953d0533f7ca4a8986fc3af53b47d3 Mon Sep 17 00:00:00 2001 From: Gulshan Singh Date: Thu, 20 Oct 2022 20:46:06 -0700 Subject: [PATCH] Fix bins command (#1313) --- pwndbg/commands/heap.py | 2 +- tests/gdb-tests/tests/heap/test_heap_bins.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pwndbg/commands/heap.py b/pwndbg/commands/heap.py index 1de85122..623e7a3e 100644 --- a/pwndbg/commands/heap.py +++ b/pwndbg/commands/heap.py @@ -40,7 +40,7 @@ def format_bin(bins: Bins, verbose=False, offset=None): offset = allocator.chunk_key_offset("fd") result = [] - bins_type = bins.BinType + bins_type = bins.bin_type for size in bins.bins: b = bins.bins[size] diff --git a/tests/gdb-tests/tests/heap/test_heap_bins.py b/tests/gdb-tests/tests/heap/test_heap_bins.py index fc4094ba..e66c8071 100644 --- a/tests/gdb-tests/tests/heap/test_heap_bins.py +++ b/tests/gdb-tests/tests/heap/test_heap_bins.py @@ -151,3 +151,5 @@ def test_heap_bins(start_binary): result = allocator.largebins() assert result.bin_type == BinType.LARGE assert result.bins[largebin_size].is_corrupted + + gdb.execute("bins")