From: Philippe Waroquiers Date: Wed, 9 Oct 2013 20:12:39 +0000 (+0000) Subject: Fix use of uninit heuristic set for monitor command X-Git-Tag: svn/VALGRIND_3_9_0~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90902aaf1369ee1d1b9b64931dee22fe3409bfb3;p=thirdparty%2Fvalgrind.git Fix use of uninit heuristic set for monitor command * initialise leak_check heuristic parameter in the leak_check monitor command * show the default value (none heuristic) in the monitor help command (none value chosen as default as this gives a backward compatible behaviour). * document the heuristic leak check parameter in memcheck manual monitor command section git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13631 --- diff --git a/gdbserver_tests/mchelp.stdoutB.exp b/gdbserver_tests/mchelp.stdoutB.exp index a2918fa3ee..c9b17299e8 100644 --- a/gdbserver_tests/mchelp.stdoutB.exp +++ b/gdbserver_tests/mchelp.stdoutB.exp @@ -29,8 +29,8 @@ memcheck monitor commands: [increased*|changed|any] [unlimited*|limited ] * = defaults - where kind is one of definite indirect possible reachable all none - where heur is one of stdstring newarray multipleinheritance all none + where kind is one of definite indirect possible reachable all none + where heur is one of stdstring newarray multipleinheritance all none* Examples: leak_check leak_check summary any leak_check full kinds indirect,possible @@ -84,8 +84,8 @@ memcheck monitor commands: [increased*|changed|any] [unlimited*|limited ] * = defaults - where kind is one of definite indirect possible reachable all none - where heur is one of stdstring newarray multipleinheritance all none + where kind is one of definite indirect possible reachable all none + where heur is one of stdstring newarray multipleinheritance all none* Examples: leak_check leak_check summary any leak_check full kinds indirect,possible diff --git a/memcheck/docs/mc-manual.xml b/memcheck/docs/mc-manual.xml index 7eee0c54a0..4c6f862e8b 100644 --- a/memcheck/docs/mc-manual.xml +++ b/memcheck/docs/mc-manual.xml @@ -1603,18 +1603,19 @@ Address 0x8049E28 len 1 defined leak_check [full*|summary] [kinds <set>|reachable|possibleleak*|definiteleak] + [heuristics heur1,heur2,...] [increased*|changed|any] [unlimited*|limited <max_loss_records_output>] performs a leak check. The * in the arguments indicates the default values. - If the first argument is summary, only a - summary of the leak search is given; otherwise a full leak report - is produced. A full leak report gives detailed information for - each leak: the stack trace where the leaked blocks were allocated, - the number of blocks leaked and their total size. When a full - report is requested, the next two arguments further specify what + If the [full*|summary] argument is + summary, only a summary of the leak search is given; + otherwise a full leak report is produced. A full leak report gives + detailed information for each leak: the stack trace where the leaked blocks + were allocated, the number of blocks leaked and their total size. When a + full report is requested, the next two arguments further specify what kind of leaks to report. A leak's details are shown if they match both the second and third argument. A full leak report might output detailed information for many leaks. The nr of leaks for @@ -1624,9 +1625,9 @@ Address 0x8049E28 len 1 defined search outputs the records with the biggest number of bytes. - The second argument controls what kind of blocks are shown for - a full leak search. The set of leak kinds to show - can be specified using a <set> similarly + The kinds argument controls what kind of blocks + are shown for a full leak search. The set of leak kinds + to show can be specified using a <set> similarly to the command line option . Alternatively, the value definiteleak is equivalent to kinds definite, the @@ -1638,8 +1639,16 @@ Address 0x8049E28 len 1 defined all). - The third argument controls what kinds of changes are shown - for a full leak search. The + The heuristics argument controls the heuristics + used during the leak search. The set of heuristics to use can be specified + using a <set> similarly + to the command line option . + The default value for the heuristics argument is + heuristics none. + + + The [increased*|changed|any] argument controls what + kinds of changes are shown for a full leak search. The value increased specifies that only block allocation stacks with an increased number of leaked bytes or blocks since the previous leak check should be shown. The diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index b27d42cb16..c3891b8270 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -5374,8 +5374,8 @@ static void print_monitor_help ( void ) " [increased*|changed|any]\n" " [unlimited*|limited ]\n" " * = defaults\n" -" where kind is one of definite indirect possible reachable all none\n" -" where heur is one of stdstring newarray multipleinheritance all none\n" +" where kind is one of definite indirect possible reachable all none\n" +" where heur is one of stdstring newarray multipleinheritance all none*\n" " Examples: leak_check\n" " leak_check summary any\n" " leak_check full kinds indirect,possible\n" @@ -5456,7 +5456,8 @@ static Bool handle_gdb_monitor_command (ThreadId tid, HChar *req) lcp.mode = LC_Full; lcp.show_leak_kinds = R2S(Possible) | R2S(Unreached); - lcp.errors_for_leak_kinds = 0; /* no errors for interactive leak search. */ + lcp.errors_for_leak_kinds = 0; // no errors for interactive leak search. + lcp.heuristics = 0; lcp.deltamode = LCD_Increased; lcp.max_loss_records_output = 999999999; lcp.requested_by_monitor_command = True;