From e26a4e7b7aae3c824b04ef329c763c293249197f Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Fri, 10 Apr 2015 16:49:02 +0200 Subject: [PATCH] malloc_debug: Also print stack traces when dumping guarded heap. --- src/system/libroot/posix/malloc_debug/guarded_heap.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/system/libroot/posix/malloc_debug/guarded_heap.cpp b/src/system/libroot/posix/malloc_debug/guarded_heap.cpp index b1c0a3e197..1a1b0a85c2 100644 --- a/src/system/libroot/posix/malloc_debug/guarded_heap.cpp +++ b/src/system/libroot/posix/malloc_debug/guarded_heap.cpp @@ -1023,8 +1023,11 @@ heap_debug_dump_heaps(bool dumpAreas, bool dumpBins) if (!dumpBins) continue; - for (size_t i = 0; i < area->page_count; i++) + for (size_t i = 0; i < area->page_count; i++) { dump_guarded_heap_page(area->pages[i]); + if ((area->pages[i].flags & GUARDED_HEAP_PAGE_FLAG_FIRST) != 0) + guarded_heap_print_stack_traces(area->pages[i]); + } } }