From: Philippe Waroquiers Date: Mon, 31 Aug 2015 22:08:47 +0000 (+0000) Subject: Have block_list showing heuristic used for a block (if block was X-Git-Tag: svn/VALGRIND_3_11_0~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80ada53b125d6445060e0d9ee42a0ef816a769c1;p=thirdparty%2Fvalgrind.git Have block_list showing heuristic used for a block (if block was found via an heuristic) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15608 --- diff --git a/NEWS b/NEWS index 49bcb1bd08..da441a299b 100644 --- a/NEWS +++ b/NEWS @@ -53,7 +53,8 @@ X86/MacOSX 10.10 and 10.11 and AMD64/MacOSX 10.10 and 10.11. - The 'block_list' monitor command now accepts an optional argument 'limited ' to control the nr of block addresses - printed. + printed. If a block has been found using an heuristic, then + 'block_list' will now show the heuristic after the block size. - The C helper functions used to instrument loads on x86-linux and arm-linux (both 32-bit only) have been replaced by handwritten diff --git a/memcheck/docs/mc-manual.xml b/memcheck/docs/mc-manual.xml index 170fe1ddb8..11ad980cd8 100644 --- a/memcheck/docs/mc-manual.xml +++ b/memcheck/docs/mc-manual.xml @@ -1918,7 +1918,8 @@ Address 0x8049E28 len 1 defined by a loss record number. The block_list command shows the loss record information followed by the addresses and sizes of the blocks which have been - merged in the loss record. + merged in the loss record. If a block was found using an heuristic, the block size + is followed by the heuristic. If a directly lost block causes some other blocks to be indirectly diff --git a/memcheck/mc_leakcheck.c b/memcheck/mc_leakcheck.c index ba48b4c275..e2f752bce9 100644 --- a/memcheck/mc_leakcheck.c +++ b/memcheck/mc_leakcheck.c @@ -1585,8 +1585,13 @@ Bool MC_(print_block_list) ( UInt loss_record_nr, UInt max_blocks) // We found an existing loss record matching this chunk. // If this is the loss record we are looking for, output the pointer. if (old_lr == lr_array[loss_record_nr]) { - VG_(umsg)("%p[%lu]\n", - (void *)ch->data, (SizeT)ch->szB); + if (ex->heuristic) + VG_(umsg)("%p[%lu] (found via heuristic %s)\n", + (void *)ch->data, (SizeT)ch->szB, + pp_heuristic (ex->heuristic)); + else + VG_(umsg)("%p[%lu]\n", + (void *)ch->data, (SizeT)ch->szB); remaining--; if (ex->state != Reachable) { // We can print the clique in all states, except Reachable.