From: Nicholas Nethercote Date: Tue, 4 Aug 2009 02:32:55 +0000 (+0000) Subject: Various option-related tweaks: X-Git-Tag: svn/VALGRIND_3_5_0~147 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8026c4766f03829ce62193564b1a369888f7a482;p=thirdparty%2Fvalgrind.git Various option-related tweaks: - Match the ordering of the non-tool-specific options in the usage message with the order in the user manual. As a result, we now always print --alignment and --trace-malloc in the core's usage messages, which saves malloc-replacing tools from doing it themselves (and brings it in line with options that only apply to error-collecting tools). - Improved the presentation of the Vex options with --help-debug. - Removed documentation of -d in the manual because it's a debugging-only flag. - Documented --read-var-info in the manual. This fixes bug 201169. - Renamed --auto-run-dsymutil as --dsymutil and documented it in the usage message. - Fixed an XML error in manual-core-adv.xml. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10703 --- diff --git a/NEWS b/NEWS index b252bf7ce3..4b0640d7c4 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,8 @@ Release 3.5.0 (???) - AMD64 (a.k.a. x86-64) are supported, but not as well. - Older PowerPC machines are not supported. - It requires Mac OS X 10.5 Leopard or later. Porting to 10.4 is not - planned because it would require work and 10.4 is only becoming less common. + planned because it would require work and 10.4 is only becoming less + common. Things that don't work: - Helgrind and Ptrcheck @@ -25,6 +26,10 @@ Release 3.5.0 (???) Hijack's fault. See https://bugs.kde.org/show_bug.cgi?id=193917 for details and a simple work-around. + Usage notes: + - You will likely find --dsymutil=yes a useful option, as error messages may + be imprecise without it. + Many thanks to Greg Parker for developing this port over several years. * XXX: something about improved Wine support? diff --git a/coregrind/m_debuginfo/readmacho.c b/coregrind/m_debuginfo/readmacho.c index 4909cac351..9ecf64c7d9 100644 --- a/coregrind/m_debuginfo/readmacho.c +++ b/coregrind/m_debuginfo/readmacho.c @@ -917,8 +917,8 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) } /* There was no dsym file, or it doesn't match. We'll have to try - regenerating it, unless auto-run-dsymutil is disabled, in which - case just complain instead. */ + regenerating it, unless --dsymutil=no, in which case just complain + instead. */ /* If this looks like a lib that we shouldn't run dsymutil on, just give up. (possible reasons: is system lib, or in /usr etc, or @@ -928,13 +928,13 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) if (is_systemish_library_name(di->filename)) goto success; - if (!VG_(clo_auto_run_dsymutil)) { + if (!VG_(clo_dsymutil)) { if (VG_(clo_verbosity) == 1) { VG_(message)(Vg_DebugMsg, "%s:\n", di->filename); } if (VG_(clo_verbosity) > 0) VG_(message)(Vg_DebugMsg, "%sdSYM directory %s; consider using " - "--auto-run-dsymutil=yes\n", + "--dsymutil=yes\n", VG_(clo_verbosity) > 1 ? " " : "", dsymfilename ? "has wrong UUID" : "is missing"); goto success; diff --git a/coregrind/m_main.c b/coregrind/m_main.c index b2bea18c66..08a96a7c9e 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -111,35 +111,23 @@ static void usage_NORETURN ( Bool debug_help ) Char* usage1 = "usage: valgrind [options] prog-and-args\n" "\n" -" common user options for all Valgrind tools, with defaults in [ ]:\n" +" tool-selection option, with default in [ ]:\n" " --tool= use the Valgrind tool named [memcheck]\n" +"\n" +" basic user options for all Valgrind tools, with defaults in [ ]:\n" " -h --help show this message\n" " --help-debug show this message, plus debugging options\n" " --version show version\n" " -q --quiet run silently; only print error msgs\n" " -v --verbose be more verbose, incl counts of errors\n" " --trace-children=no|yes Valgrind-ise child processes (follow execve)? [no]\n" -" --child-silent-after-fork=no|yes omit child output between fork & exec? [no]\n" +" --child-silent-after-fork=no|yes omit child output between fork & exec? [no]\n" " --track-fds=no|yes track open file descriptors? [no]\n" " --time-stamp=no|yes add timestamps to log messages? [no]\n" " --log-fd= log messages to file descriptor [2=stderr]\n" " --log-file= log messages to \n" " --log-socket=ipaddr:port log messages to socket ipaddr:port\n" "\n" -" uncommon user options for all Valgrind tools:\n" -" --run-libc-freeres=no|yes free up glibc memory at exit? [yes]\n" -" --sim-hints=hint1,hint2,... known hints:\n" -" lax-ioctls, enable-outer [none]\n" -" --show-emwarns=no|yes show warnings about emulation limits? [no]\n" -" --smc-check=none|stack|all checks for self-modifying code: none,\n" -" only for code found in stacks, or all [stack]\n" -" --kernel-variant=variant1,variant2,... known variants: bproc [none]\n" -" handle non-standard kernel variants\n" -" --read-var-info=yes|no read debug info on stack and global variables\n" -" and use it to print better error messages in\n" -" tools that make use of it (Memcheck, Helgrind,\n" -" DRD)\n" -"\n" " user options for Valgrind tools that report errors:\n" " --xml=yes emit error output in XML (some tools only)\n" " --xml-fd= XML output to file descriptor\n" @@ -156,15 +144,34 @@ static void usage_NORETURN ( Bool debug_help ) " --db-attach=no|yes start debugger when errors detected? [no]\n" " --db-command= command to start debugger [%s -nw %%f %%p]\n" " --input-fd= file descriptor for input [0=stdin]\n" +" --dsymutil=no|yes run dsymutil on Mac OS X when helpful? [no]\n" " --max-stackframe= assume stack switch for SP changes larger\n" " than bytes [2000000]\n" " --main-stacksize= set size of main thread's stack (in bytes)\n" " [use current 'ulimit' value]\n" +"\n" +" user options for Valgrind tools that replace malloc:\n" +" --alignment= set minimum alignment of heap allocations [%ld]\n" +"\n" +" uncommon user options for all Valgrind tools:\n" +" --smc-check=none|stack|all checks for self-modifying code: none,\n" +" only for code found in stacks, or all [stack]\n" +" --read-var-info=yes|no read debug info on stack and global variables\n" +" and use it to print better error messages in\n" +" tools that make use of it (Memcheck, Helgrind,\n" +" DRD)\n" +" --run-libc-freeres=no|yes free up glibc memory at exit on Linux? [yes]\n" +" --sim-hints=hint1,hint2,... known hints:\n" +" lax-ioctls, enable-outer [none]\n" +" --kernel-variant=variant1,variant2,... known variants: bproc [none]\n" +" handle non-standard kernel variants\n" +" --show-emwarns=no|yes show warnings about emulation limits? [no]\n" "\n"; Char* usage2 = "\n" " debugging options for all Valgrind tools:\n" +" -d show verbose debugging output\n" " --sanity-level= level of sanity checking to do [1]\n" " --trace-flags= show generated code? (X = 0|1) [00000000]\n" " --profile-flags= ditto, but for profiling (X = 0|1) [00000000]\n" @@ -184,13 +191,13 @@ static void usage_NORETURN ( Bool debug_help ) " --sym-offsets=yes|no show syms in form 'name+offset' ? [no]\n" " --command-line-only=no|yes only use command line options [no]\n" "\n" -" --vex-iropt-verbosity 0 .. 9 [0]\n" -" --vex-iropt-level 0 .. 2 [2]\n" -" --vex-iropt-precise-memory-exns [no]\n" -" --vex-iropt-unroll-thresh 0 .. 400 [120]\n" -" --vex-guest-max-insns 1 .. 100 [50]\n" -" --vex-guest-chase-thresh 0 .. 99 [10]\n" -"\n" +" Vex options for all Valgrind tools:\n" +" --vex-iropt-verbosity=<0..9> [0]\n" +" --vex-iropt-level=<0..2> [2]\n" +" --vex-iropt-precise-memory-exns=no|yes [no]\n" +" --vex-iropt-unroll-thresh=<0..400> [120]\n" +" --vex-guest-max-insns=<1..100> [50]\n" +" --vex-guest-chase-thresh=<0..99> [10]\n" " --trace-flags and --profile-flags values (omit the middle space):\n" " 1000 0000 show conversion into IR\n" " 0100 0000 show after initial opt\n" @@ -205,6 +212,9 @@ static void usage_NORETURN ( Bool debug_help ) " debugging options for Valgrind tools that report errors\n" " --dump-error= show translation for basic block associated\n" " with 'th error context [0=show none]\n" +"\n" +" debugging options for Valgrind tools that replace malloc:\n" +" --trace-malloc=no|yes show client malloc details? [no]\n" "\n"; Char* usage3 = @@ -224,8 +234,8 @@ static void usage_NORETURN ( Bool debug_help ) VG_(log_output_sink).fd = 1; VG_(log_output_sink).is_socket = False; - /* 'usage1' expects one char* argument */ - VG_(printf)(usage1, gdb_path); + /* 'usage1' expects one char* argument and one SizeT argument. */ + VG_(printf)(usage1, gdb_path, VG_MIN_MALLOC_SZB); if (VG_(details).name) { VG_(printf)(" user options for %s:\n", VG_(details).name); if (VG_(needs).command_line_options) @@ -474,10 +484,9 @@ void main_process_cmd_line_options ( /*OUT*/Bool* logging_to_fd, else if VG_XACT_CLO(arg, "--smc-check=all", VG_(clo_smc_check), Vg_SmcAll); - else if VG_STR_CLO (arg, "--kernel-variant", VG_(clo_kernel_variant)) {} + else if VG_STR_CLO (arg, "--kernel-variant", VG_(clo_kernel_variant)) {} - else if VG_BOOL_CLO(arg, "--auto-run-dsymutil", - VG_(clo_auto_run_dsymutil)) {} + else if VG_BOOL_CLO(arg, "--dsymutil", VG_(clo_dsymutil)) {} else if VG_BINT_CLO(arg, "--vex-iropt-verbosity", VG_(clo_vex_control).iropt_verbosity, 0, 10) {} diff --git a/coregrind/m_options.c b/coregrind/m_options.c index 5db49f56f6..0738befe53 100644 --- a/coregrind/m_options.c +++ b/coregrind/m_options.c @@ -90,7 +90,7 @@ Word VG_(clo_main_stacksize) = 0; /* use client's rlimit.stack */ Bool VG_(clo_wait_for_gdb) = False; VgSmc VG_(clo_smc_check) = Vg_SmcStack; HChar* VG_(clo_kernel_variant) = NULL; -Bool VG_(clo_auto_run_dsymutil) = False; +Bool VG_(clo_dsymutil) = False; /*====================================================================*/ diff --git a/coregrind/m_replacemalloc/replacemalloc_core.c b/coregrind/m_replacemalloc/replacemalloc_core.c index de1d9841b4..a7f620d93f 100644 --- a/coregrind/m_replacemalloc/replacemalloc_core.c +++ b/coregrind/m_replacemalloc/replacemalloc_core.c @@ -74,21 +74,6 @@ Bool VG_(replacement_malloc_process_cmd_line_option)(Char* arg) return True; } -void VG_(replacement_malloc_print_usage)(void) -{ - VG_(printf)( -" --alignment= set minimum alignment of allocations [%d]\n", - VG_MIN_MALLOC_SZB - ); -} - -void VG_(replacement_malloc_print_debug_usage)(void) -{ - VG_(printf)( -" --trace-malloc=no|yes show client malloc details? [no]\n" - ); -} - /*------------------------------------------------------------*/ /*--- Useful functions ---*/ /*------------------------------------------------------------*/ diff --git a/coregrind/pub_core_options.h b/coregrind/pub_core_options.h index b113a7e9de..37242b5af0 100644 --- a/coregrind/pub_core_options.h +++ b/coregrind/pub_core_options.h @@ -168,7 +168,7 @@ extern HChar* VG_(clo_kernel_variant); /* Darwin-specific: automatically run /usr/bin/dsymutil to update .dSYM directories as necessary? */ -extern Bool VG_(clo_auto_run_dsymutil); +extern Bool VG_(clo_dsymutil); /* --------- Functions --------- */ diff --git a/docs/xml/manual-core-adv.xml b/docs/xml/manual-core-adv.xml index 017304fd95..8d5bcc6cea 100644 --- a/docs/xml/manual-core-adv.xml +++ b/docs/xml/manual-core-adv.xml @@ -228,7 +228,7 @@ tool-specific macros). VALGRIND_PRINTF_BACKTRACE(format, ...): - Like VALGRIND_PRINTF, but prints + Like VALGRIND_PRINTF, but prints a stack backtrace immediately afterwards. diff --git a/docs/xml/manual-core.xml b/docs/xml/manual-core.xml index e3ea2a7df3..3335ea113e 100644 --- a/docs/xml/manual-core.xml +++ b/docs/xml/manual-core.xml @@ -641,18 +641,6 @@ in most cases. We group the available options by rough categories. - - - - Emit information for debugging Valgrind itself. This is - usually only of interest to the Valgrind developers. Repeating - the flag produces more detailed output. If you want to send us a - bug report, a log of the output generated by - will make your report more - useful. - - - @@ -1108,9 +1096,9 @@ that can report errors, e.g. Memcheck, but not Cachegrind. - + - + This flag is only relevant when running Valgrind on @@ -1128,7 +1116,7 @@ that can report errors, e.g. Memcheck, but not Cachegrind. executable or .dylib, but with the extension .dSYM. - With , Valgrind + With , Valgrind will detect cases where the .dSYM directory is either missing, or is present but does not appear to match the @@ -1136,11 +1124,11 @@ that can report errors, e.g. Memcheck, but not Cachegrind. most likely because it is out of date. In these cases, Valgrind will print a warning message but take no further action. - With , Valgrind + With , Valgrind will, in such cases, automatically run dsymutil as necessary to bring the debuginfo up to date. For all practical purposes, if - you always use , then + you always use , then there is never any need to run dsymutil manually or as part of your applications's build system, since Valgrind will run it @@ -1164,7 +1152,7 @@ that can report errors, e.g. Memcheck, but not Cachegrind. directories. Be careful when - using , since it will + using , since it will cause pre-existing .dSYM directories to be silently deleted and re-created. Also note the dsymutil is quite slow, sometimes @@ -1309,6 +1297,82 @@ need to use these. + + + + + + This option controls Valgrind's detection of self-modifying + code. If no checking is done, if a program executes some code, then + overwrites it with new code, and executes the new code, Valgrind will + continue to execute the translations it made for the old code. This + will likely lead to incorrect behaviour and/or crashes. + + Valgrind has three levels of self-modifying code detection: + no detection, detect self-modifying code on the stack (which used by + GCC to implement nested functions), or detect self-modifying code + everywhere. Note that the default option will catch the vast majority + of cases. The main case it will not catch is programs such as JIT + compilers that dynamically generate code and + subsequently overwrite part or all of it. Running with + all will slow Valgrind down greatly. Running with + none will rarely speed things up, since very little + code gets put on the stack for most programs. The + VALGRIND_DISCARD_TRANSLATIONS client request is + an alternative to that requires more + effort but is much faster; see for more details. + + Some architectures (including ppc32 and ppc64) require + programs which create code at runtime to flush the instruction + cache in between code generation and first use. Valgrind + observes and honours such instructions. Hence, on ppc32/Linux + and ppc64/Linux, Valgrind always provides complete, transparent + support for self-modifying code. It is only on platforms such as + x86/Linux, AMD64/Linux and x86/Darwin that you need to use this + flag. + + + + + + + + + When enabled, Valgrind will read information about variables from + debug info. This slows Valgrind down and makes it use more memory, but + for the tools that can take advantage of it (Memcheck, Helgrind, DRD) it + can result in more precise error messages. For example, here are some + standard errors issued by Memcheck: + + + And here are the same errors with + : + + + + + @@ -1403,43 +1467,6 @@ need to use these. - - - - - - This option controls Valgrind's detection of self-modifying - code. If no checking is done, if a program executes some code, then - overwrites it with new code, and executes the new code, Valgrind will - continue to execute the translations it made for the old code. This - will likely lead to incorrect behaviour and/or crashes. - - Valgrind has three levels of self-modifying code detection: - no detection, detect self-modifying code on the stack (which used by - GCC to implement nested functions), or detect self-modifying code - everywhere. Note that the default option will catch the vast majority - of cases. The main case it will not catch is programs such as JIT - compilers that dynamically generate code and - subsequently overwrite part or all of it. Running with - all will slow Valgrind down greatly. Running with - none will rarely speed things up, since very little - code gets put on the stack for most programs. The - VALGRIND_DISCARD_TRANSLATIONS client request is - an alternative to that requires more - effort but is much faster; see for more details. - - Some architectures (including ppc32 and ppc64) require - programs which create code at runtime to flush the instruction - cache in between code generation and first use. Valgrind - observes and honours such instructions. Hence, on ppc32/Linux - and ppc64/Linux, Valgrind always provides complete, transparent - support for self-modifying code. It is only on platforms such as - x86/Linux, AMD64/Linux and x86/Darwin that you need to use this - flag. - - - diff --git a/drd/drd_main.c b/drd/drd_main.c index 82deb9dc8b..840b8d5b9d 100644 --- a/drd/drd_main.c +++ b/drd/drd_main.c @@ -211,7 +211,6 @@ static void DRD_(print_usage)(void) " --trace-semaphore=yes|no Trace all semaphore activity [no].\n", DRD_(thread_get_segment_merge_interval)() ); - VG_(replacement_malloc_print_usage)(); } static void DRD_(print_debug_usage)(void) @@ -227,7 +226,6 @@ static void DRD_(print_debug_usage)(void) " --trace-segment=yes|no Trace segment actions [no].\n" " --trace-suppr=yes|no Trace all address suppression actions [no].\n" ); - VG_(replacement_malloc_print_debug_usage)(); } diff --git a/exp-ptrcheck/pc_common.c b/exp-ptrcheck/pc_common.c index 4b6298b82b..0421e6ba46 100644 --- a/exp-ptrcheck/pc_common.c +++ b/exp-ptrcheck/pc_common.c @@ -80,17 +80,14 @@ void pc_print_usage(void) " --partial-loads-ok=no|yes same as for Memcheck [yes]\n" " --enable-sg-checks=no|yes enable stack & global array checking? [yes]\n" ); - VG_(replacement_malloc_print_usage)(); } void pc_print_debug_usage(void) { - /* VG_(printf)( - " --lossage-check=no|yes gather stats for quality control [no]\n" +" (none)\n" +//" --lossage-check=no|yes gather stats for quality control [no]\n" ); - */ - VG_(replacement_malloc_print_debug_usage)(); } diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index f5495313a3..6798065fd3 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -4216,12 +4216,10 @@ static void hg_print_usage ( void ) " none: only show trace for one thread in a race (fastest)\n" " --conflict-cache-size=N size of 'full' history cache [1000000]\n" ); - VG_(replacement_malloc_print_usage)(); } static void hg_print_debug_usage ( void ) { - VG_(replacement_malloc_print_debug_usage)(); VG_(printf)(" --cmp-race-err-addrs=no|yes are data addresses in " "race errors significant? [no]\n"); VG_(printf)(" --hg-sanity-flags= sanity check " diff --git a/include/pub_tool_replacemalloc.h b/include/pub_tool_replacemalloc.h index 9cb2e9e3d8..067b7ff053 100644 --- a/include/pub_tool_replacemalloc.h +++ b/include/pub_tool_replacemalloc.h @@ -64,8 +64,6 @@ extern Bool VG_(clo_trace_malloc); extern UInt VG_(clo_alignment); extern Bool VG_(replacement_malloc_process_cmd_line_option) ( Char* arg ); -extern void VG_(replacement_malloc_print_usage) ( void ); -extern void VG_(replacement_malloc_print_debug_usage) ( void ); #endif // __PUB_TOOL_REPLACEMALLOC_H diff --git a/massif/ms_main.c b/massif/ms_main.c index 44e5816344..2b41fb7d32 100644 --- a/massif/ms_main.c +++ b/massif/ms_main.c @@ -460,12 +460,13 @@ static void ms_print_usage(void) " --max-snapshots= maximum number of snapshots recorded [100]\n" " --massif-out-file= output file name [massif.out.%%p]\n" ); - VG_(replacement_malloc_print_usage)(); } static void ms_print_debug_usage(void) { - VG_(replacement_malloc_print_debug_usage)(); + VG_(printf)( +" (none)\n" + ); } diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 4882f3b43f..7929d24541 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -4785,12 +4785,13 @@ static void mc_print_usage(void) " --malloc-fill= fill malloc'd areas with given value\n" " --free-fill= fill free'd areas with given value\n" ); - VG_(replacement_malloc_print_usage)(); } static void mc_print_debug_usage(void) { - VG_(replacement_malloc_print_debug_usage)(); + VG_(printf)( +" (none)\n" + ); } diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 4d0c21d71e..154d4e1cd6 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -34,6 +34,7 @@ DIST_SUBDIRS = x86 amd64 ppc32 ppc64 linux darwin x86-linux . dist_noinst_SCRIPTS = \ filter_cmdline0 \ + filter_cmdline1 \ filter_fdleak \ filter_linenos \ filter_none_discards \ diff --git a/none/tests/cmdline1.stdout.exp b/none/tests/cmdline1.stdout.exp index 6c9a474212..ee3dfdbf20 100644 --- a/none/tests/cmdline1.stdout.exp +++ b/none/tests/cmdline1.stdout.exp @@ -1,34 +1,22 @@ usage: valgrind [options] prog-and-args - common user options for all Valgrind tools, with defaults in [ ]: + tool-selection option, with default in [ ]: --tool= use the Valgrind tool named [memcheck] + + basic user options for all Valgrind tools, with defaults in [ ]: -h --help show this message --help-debug show this message, plus debugging options --version show version -q --quiet run silently; only print error msgs -v --verbose be more verbose, incl counts of errors --trace-children=no|yes Valgrind-ise child processes (follow execve)? [no] - --child-silent-after-fork=no|yes omit child output between fork & exec? [no] + --child-silent-after-fork=no|yes omit child output between fork & exec? [no] --track-fds=no|yes track open file descriptors? [no] --time-stamp=no|yes add timestamps to log messages? [no] --log-fd= log messages to file descriptor [2=stderr] --log-file= log messages to --log-socket=ipaddr:port log messages to socket ipaddr:port - uncommon user options for all Valgrind tools: - --run-libc-freeres=no|yes free up glibc memory at exit? [yes] - --sim-hints=hint1,hint2,... known hints: - lax-ioctls, enable-outer [none] - --show-emwarns=no|yes show warnings about emulation limits? [no] - --smc-check=none|stack|all checks for self-modifying code: none, - only for code found in stacks, or all [stack] - --kernel-variant=variant1,variant2,... known variants: bproc [none] - handle non-standard kernel variants - --read-var-info=yes|no read debug info on stack and global variables - and use it to print better error messages in - tools that make use of it (Memcheck, Helgrind, - DRD) - user options for Valgrind tools that report errors: --xml=yes emit error output in XML (some tools only) --xml-fd= XML output to file descriptor @@ -45,11 +33,29 @@ usage: valgrind [options] prog-and-args --db-attach=no|yes start debugger when errors detected? [no] --db-command= command to start debugger [/usr/bin/gdb -nw %f %p] --input-fd= file descriptor for input [0=stdin] + --dsymutil=no|yes run dsymutil on Mac OS X when helpful? [no] --max-stackframe= assume stack switch for SP changes larger than bytes [2000000] --main-stacksize= set size of main thread's stack (in bytes) [use current 'ulimit' value] + user options for Valgrind tools that replace malloc: + --alignment= set minimum alignment of heap allocations [...] + + uncommon user options for all Valgrind tools: + --smc-check=none|stack|all checks for self-modifying code: none, + only for code found in stacks, or all [stack] + --read-var-info=yes|no read debug info on stack and global variables + and use it to print better error messages in + tools that make use of it (Memcheck, Helgrind, + DRD) + --run-libc-freeres=no|yes free up glibc memory at exit on Linux? [yes] + --sim-hints=hint1,hint2,... known hints: + lax-ioctls, enable-outer [none] + --kernel-variant=variant1,variant2,... known variants: bproc [none] + handle non-standard kernel variants + --show-emwarns=no|yes show warnings about emulation limits? [no] + user options for Nulgrind: (none) diff --git a/none/tests/cmdline1.vgtest b/none/tests/cmdline1.vgtest index ca5ded25f6..599140b9cd 100644 --- a/none/tests/cmdline1.vgtest +++ b/none/tests/cmdline1.vgtest @@ -1 +1,2 @@ vgopts: --help --tool=none +stdout_filter: filter_cmdline1 diff --git a/none/tests/cmdline2.stdout.exp b/none/tests/cmdline2.stdout.exp index 98dd177ef6..dc147a448e 100644 --- a/none/tests/cmdline2.stdout.exp +++ b/none/tests/cmdline2.stdout.exp @@ -1,34 +1,22 @@ usage: valgrind [options] prog-and-args - common user options for all Valgrind tools, with defaults in [ ]: + tool-selection option, with default in [ ]: --tool= use the Valgrind tool named [memcheck] + + basic user options for all Valgrind tools, with defaults in [ ]: -h --help show this message --help-debug show this message, plus debugging options --version show version -q --quiet run silently; only print error msgs -v --verbose be more verbose, incl counts of errors --trace-children=no|yes Valgrind-ise child processes (follow execve)? [no] - --child-silent-after-fork=no|yes omit child output between fork & exec? [no] + --child-silent-after-fork=no|yes omit child output between fork & exec? [no] --track-fds=no|yes track open file descriptors? [no] --time-stamp=no|yes add timestamps to log messages? [no] --log-fd= log messages to file descriptor [2=stderr] --log-file= log messages to --log-socket=ipaddr:port log messages to socket ipaddr:port - uncommon user options for all Valgrind tools: - --run-libc-freeres=no|yes free up glibc memory at exit? [yes] - --sim-hints=hint1,hint2,... known hints: - lax-ioctls, enable-outer [none] - --show-emwarns=no|yes show warnings about emulation limits? [no] - --smc-check=none|stack|all checks for self-modifying code: none, - only for code found in stacks, or all [stack] - --kernel-variant=variant1,variant2,... known variants: bproc [none] - handle non-standard kernel variants - --read-var-info=yes|no read debug info on stack and global variables - and use it to print better error messages in - tools that make use of it (Memcheck, Helgrind, - DRD) - user options for Valgrind tools that report errors: --xml=yes emit error output in XML (some tools only) --xml-fd= XML output to file descriptor @@ -45,15 +33,34 @@ usage: valgrind [options] prog-and-args --db-attach=no|yes start debugger when errors detected? [no] --db-command= command to start debugger [/usr/bin/gdb -nw %f %p] --input-fd= file descriptor for input [0=stdin] + --dsymutil=no|yes run dsymutil on Mac OS X when helpful? [no] --max-stackframe= assume stack switch for SP changes larger than bytes [2000000] --main-stacksize= set size of main thread's stack (in bytes) [use current 'ulimit' value] + user options for Valgrind tools that replace malloc: + --alignment= set minimum alignment of heap allocations [...] + + uncommon user options for all Valgrind tools: + --smc-check=none|stack|all checks for self-modifying code: none, + only for code found in stacks, or all [stack] + --read-var-info=yes|no read debug info on stack and global variables + and use it to print better error messages in + tools that make use of it (Memcheck, Helgrind, + DRD) + --run-libc-freeres=no|yes free up glibc memory at exit on Linux? [yes] + --sim-hints=hint1,hint2,... known hints: + lax-ioctls, enable-outer [none] + --kernel-variant=variant1,variant2,... known variants: bproc [none] + handle non-standard kernel variants + --show-emwarns=no|yes show warnings about emulation limits? [no] + user options for Nulgrind: (none) debugging options for all Valgrind tools: + -d show verbose debugging output --sanity-level= level of sanity checking to do [1] --trace-flags= show generated code? (X = 0|1) [00000000] --profile-flags= ditto, but for profiling (X = 0|1) [00000000] @@ -73,13 +80,13 @@ usage: valgrind [options] prog-and-args --sym-offsets=yes|no show syms in form 'name+offset' ? [no] --command-line-only=no|yes only use command line options [no] - --vex-iropt-verbosity 0 .. 9 [0] - --vex-iropt-level 0 .. 2 [2] - --vex-iropt-precise-memory-exns [no] - --vex-iropt-unroll-thresh 0 .. 400 [120] - --vex-guest-max-insns 1 .. 100 [50] - --vex-guest-chase-thresh 0 .. 99 [10] - + Vex options for all Valgrind tools: + --vex-iropt-verbosity=<0..9> [0] + --vex-iropt-level=<0..2> [2] + --vex-iropt-precise-memory-exns=no|yes [no] + --vex-iropt-unroll-thresh=<0..400> [120] + --vex-guest-max-insns=<1..100> [50] + --vex-guest-chase-thresh=<0..99> [10] --trace-flags and --profile-flags values (omit the middle space): 1000 0000 show conversion into IR 0100 0000 show after initial opt @@ -95,6 +102,9 @@ usage: valgrind [options] prog-and-args --dump-error= show translation for basic block associated with 'th error context [0=show none] + debugging options for Valgrind tools that replace malloc: + --trace-malloc=no|yes show client malloc details? [no] + debugging options for Nulgrind: (none) diff --git a/none/tests/cmdline2.vgtest b/none/tests/cmdline2.vgtest index 84fc42ff62..ba903f5917 100644 --- a/none/tests/cmdline2.vgtest +++ b/none/tests/cmdline2.vgtest @@ -1 +1,2 @@ vgopts: --help-debug --tool=none +stdout_filter: filter_cmdline1 diff --git a/none/tests/filter_cmdline1 b/none/tests/filter_cmdline1 new file mode 100755 index 0000000000..e6b58ae0d3 --- /dev/null +++ b/none/tests/filter_cmdline1 @@ -0,0 +1,4 @@ +#! /bin/sh + +perl -p -e 's/(set minimum alignment of heap allocations) \[(8|16)\]/$1 [...]/' +