]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Various option-related tweaks:
authorNicholas Nethercote <njn@valgrind.org>
Tue, 4 Aug 2009 02:32:55 +0000 (02:32 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 4 Aug 2009 02:32:55 +0000 (02:32 +0000)
- 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

20 files changed:
NEWS
coregrind/m_debuginfo/readmacho.c
coregrind/m_main.c
coregrind/m_options.c
coregrind/m_replacemalloc/replacemalloc_core.c
coregrind/pub_core_options.h
docs/xml/manual-core-adv.xml
docs/xml/manual-core.xml
drd/drd_main.c
exp-ptrcheck/pc_common.c
helgrind/hg_main.c
include/pub_tool_replacemalloc.h
massif/ms_main.c
memcheck/mc_main.c
none/tests/Makefile.am
none/tests/cmdline1.stdout.exp
none/tests/cmdline1.vgtest
none/tests/cmdline2.stdout.exp
none/tests/cmdline2.vgtest
none/tests/filter_cmdline1 [new file with mode: 0755]

diff --git a/NEWS b/NEWS
index b252bf7ce39ea8580e3e2a8eda17706eb2fe983d..4b0640d7c405d3de08c4d4dfae7e4c78ec367b7f 100644 (file)
--- 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?
index 4909cac351f8d7d4a58df21ea25bf1fd17de8ffe..9ecf64c7d925311c2b1ed1e3f4944294946828cf 100644 (file)
@@ -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;
index b2bea18c660168dc561d41258df7039b44cc4a63..08a96a7c9e601da280721c1c5a47b1d40ca47ec9 100644 (file)
@@ -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=<name>             use the Valgrind tool named <name> [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=<number>         log messages to file descriptor [2=stderr]\n"
 "    --log-file=<file>         log messages to <file>\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=<number>         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>    command to start debugger [%s -nw %%f %%p]\n"
 "    --input-fd=<number>       file descriptor for input [0=stdin]\n"
+"    --dsymutil=no|yes         run dsymutil on Mac OS X when helpful? [no]\n"
 "    --max-stackframe=<number> assume stack switch for SP changes larger\n"
 "                              than <number> bytes [2000000]\n"
 "    --main-stacksize=<number> 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=<number>      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=<number>   level of sanity checking to do [1]\n"
 "    --trace-flags=<XXXXXXXX>   show generated code? (X = 0|1) [00000000]\n"
 "    --profile-flags=<XXXXXXXX> 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=<number>     show translation for basic block associated\n"
 "                              with <number>'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) {}
index 5db49f56f68fc34c03853241d077cfdf42cf7677..0738befe53681008d990740e56a3515eb91426c9 100644 (file)
@@ -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;
 
 
 /*====================================================================*/
index de1d9841b4728d6339e3b512a3f74f84e8aeb391..a7f620d93fe4312b61dd0c96ed7e6012e446a8aa 100644 (file)
@@ -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=<number>      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                                     ---*/
 /*------------------------------------------------------------*/
index b113a7e9dea35e717f188033b210b862eb11d9d5..37242b5af0f5aa101be9a36d81cb9d71e96d6c61 100644 (file)
@@ -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 --------- */
 
index 017304fd95071bd4cc79eeb60bae57b56537a204..8d5bcc6ceabfccbc4717dbf7f0e37a78c9217395 100644 (file)
@@ -228,7 +228,7 @@ tool-specific macros).</para>
   <varlistentry>
    <term><command><computeroutput>VALGRIND_PRINTF_BACKTRACE(format, ...)</computeroutput>:</command></term>
    <listitem>
-    <para>Like <computeroutput>VALGRIND_PRINTF<computeroutput>, but prints
+    <para>Like <computeroutput>VALGRIND_PRINTF</computeroutput>, but prints
     a stack backtrace immediately afterwards.</para>
    </listitem>
   </varlistentry>
index e3ea2a7df31bb0406b5530990a0237c3939eae87..3335ea113ef35093eba79fce188f4232d83c1f95 100644 (file)
@@ -641,18 +641,6 @@ in most cases.  We group the available options by rough categories.</para>
     </listitem>
   </varlistentry>
 
-  <varlistentry id="opt.d" xreflabel="-d">
-    <term><option>-d</option></term>
-    <listitem>
-      <para>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 
-      <option>-v -v -d -d</option> will make your report more
-      useful.</para>
-    </listitem>
-  </varlistentry>
-
   <varlistentry id="opt.trace-children" xreflabel="--trace-children">
     <term>
       <option><![CDATA[--trace-children=<yes|no> [default: no] ]]></option>
@@ -1108,9 +1096,9 @@ that can report errors, e.g. Memcheck, but not Cachegrind.</para>
     </listitem>
   </varlistentry>
 
-  <varlistentry id="opt.auto-run-dsymutil" xreflabel="--auto-run-dsymutil">
+  <varlistentry id="opt.dsymutil" xreflabel="--dsymutil">
     <term>
-      <option><![CDATA[--auto-run-dsymutil=no|yes [no] ]]></option>
+      <option><![CDATA[--dsymutil=no|yes [no] ]]></option>
     </term>
     <listitem>
       <para>This flag is only relevant when running Valgrind on
@@ -1128,7 +1116,7 @@ that can report errors, e.g. Memcheck, but not Cachegrind.</para>
       executable or <computeroutput>.dylib</computeroutput>, but with
       the extension <computeroutput>.dSYM</computeroutput>.</para>
 
-      <para>With <option>--auto-run-dsymutil=no</option>, Valgrind
+      <para>With <option>--dsymutil=no</option>, Valgrind
       will detect cases where the
       <computeroutput>.dSYM</computeroutput> 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.</para>
       most likely because it is out of date.  In these cases, Valgrind
       will print a warning message but take no further action.</para>
 
-      <para>With <option>--auto-run-dsymutil=yes</option>, Valgrind
+      <para>With <option>--dsymutil=yes</option>, Valgrind
       will, in such cases, automatically
       run <computeroutput>dsymutil</computeroutput> as necessary to
       bring the debuginfo up to date.  For all practical purposes, if
-      you always use <option>--auto-run-dsymutil=yes</option>, then
+      you always use <option>--dsymutil=yes</option>, then
       there is never any need to
       run <computeroutput>dsymutil</computeroutput> 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.</para>
       directories.</para>
 
       <para>Be careful when
-      using <option>--auto-run-dsymutil=yes</option>, since it will
+      using <option>--dsymutil=yes</option>, since it will
       cause pre-existing <computeroutput>.dSYM</computeroutput>
       directories to be silently deleted and re-created.  Also note the
       <computeroutput>dsymutil</computeroutput> is quite slow, sometimes
@@ -1309,6 +1297,82 @@ need to use these.</para>
 
 <variablelist id="uncommon.opts.list">
 
+  <varlistentry id="opt.smc-check" xreflabel="--smc-check">
+    <term>
+      <option><![CDATA[--smc-check=<none|stack|all> [default: stack] ]]></option>
+    </term>
+    <listitem>
+      <para>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.</para>
+      
+      <para>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 <emphasis>and</emphasis>
+      subsequently overwrite part or all of it.  Running with
+      <varname>all</varname> will slow Valgrind down greatly.  Running with
+      <varname>none</varname> will rarely speed things up, since very little
+      code gets put on the stack for most programs.  The
+      <function>VALGRIND_DISCARD_TRANSLATIONS</function> client request is
+      an alternative to <option>--smc-check=all</option> that requires more
+      effort but is much faster;  see <xref
+      linkend="manual-core-adv.clientreq"/> for more details.</para>
+
+      <para>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.</para>
+    </listitem>
+  </varlistentry>
+
+  <varlistentry id="opt.read-var-info" xreflabel="--read-var-info">
+    <term>
+      <option><![CDATA[--read-var-info=<yes|no> [default: no] ]]></option>
+    </term>
+    <listitem>
+      <para>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:</para>
+<programlisting><![CDATA[
+==15516== Uninitialised byte(s) found during client check request
+==15516==    at 0x400633: croak (varinfo1.c:28)
+==15516==    by 0x4006B2: main (varinfo1.c:55)
+==15516==  Address 0x60103b is 7 bytes inside data symbol "global_i2"
+==15516== 
+==15516== Uninitialised byte(s) found during client check request
+==15516==    at 0x400633: croak (varinfo1.c:28)
+==15516==    by 0x4006BC: main (varinfo1.c:56)
+==15516==  Address 0x7fefffefc is on thread 1's stack]]></programlisting>
+
+      <para>And here are the same errors with
+      <option>--read-var-info=yes</option>:</para>
+
+<programlisting><![CDATA[
+==15522== Uninitialised byte(s) found during client check request
+==15522==    at 0x400633: croak (varinfo1.c:28)
+==15522==    by 0x4006B2: main (varinfo1.c:55)
+==15522==  Location 0x60103b is 0 bytes inside global_i2[7],
+==15522==  a global variable declared at varinfo1.c:41
+==15522== 
+==15522== Uninitialised byte(s) found during client check request
+==15522==    at 0x400633: croak (varinfo1.c:28)
+==15522==    by 0x4006BC: main (varinfo1.c:56)
+==15522==  Location 0x7fefffefc is 0 bytes inside local var "local"
+==15522==  declared at varinfo1.c:46, in frame #1 of thread 1]]></programlisting>
+    </listitem>
+  </varlistentry>
+
   <varlistentry id="opt.run-libc-freeres" xreflabel="--run-libc-freeres">
     <term>
       <option><![CDATA[--run-libc-freeres=<yes|no> [default: yes] ]]></option>
@@ -1403,43 +1467,6 @@ need to use these.</para>
    </listitem>
   </varlistentry>
 
-  <varlistentry id="opt.smc-check" xreflabel="--smc-check">
-    <term>
-      <option><![CDATA[--smc-check=<none|stack|all> [default: stack] ]]></option>
-    </term>
-    <listitem>
-      <para>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.</para>
-      
-      <para>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 <emphasis>and</emphasis>
-      subsequently overwrite part or all of it.  Running with
-      <varname>all</varname> will slow Valgrind down greatly.  Running with
-      <varname>none</varname> will rarely speed things up, since very little
-      code gets put on the stack for most programs.  The
-      <function>VALGRIND_DISCARD_TRANSLATIONS</function> client request is
-      an alternative to <option>--smc-check=all</option> that requires more
-      effort but is much faster;  see <xref
-      linkend="manual-core-adv.clientreq"/> for more details.</para>
-
-      <para>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.</para>
-    </listitem>
-  </varlistentry>
-
 </variablelist>
 <!-- end of xi:include in the manpage -->
 
index 82deb9dc8b1035cb918cc020918311b20d0a26a7..840b8d5b9d73d2614aa8ada3240dab9a527eb1ba 100644 (file)
@@ -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)();
 }
 
 
index 4b6298b82bf352aa9f9fe2b8e1448cdb5bba3259..0421e6ba46b7397a17f3bdea7088645a8ce9d317 100644 (file)
@@ -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)();
 }
 
 
index f5495313a3a690e13d8e04f90b4e00376bfd575a..6798065fd39f62b42b345bc07b9e46fadb25026d 100644 (file)
@@ -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=<XXXXXX>   sanity check "
index 9cb2e9e3d8a4b8cb6183a83fd688b2d878df7c1f..067b7ff05348bcb4a7db26c4779ff346a16e00f2 100644 (file)
@@ -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
 
index 44e5816344f38f8f8404609ccad14d66788906de..2b41fb7d3205cc5fc47d3b1d63be4b75095cb9e3 100644 (file)
@@ -460,12 +460,13 @@ static void ms_print_usage(void)
 "    --max-snapshots=<N>       maximum number of snapshots recorded [100]\n"
 "    --massif-out-file=<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"
+   );
 }
 
 
index 4882f3b43fd28cfc80d83ddef21d5cc2279f1181..7929d245410bcbaacf863761d09ba2b03bb24452 100644 (file)
@@ -4785,12 +4785,13 @@ static void mc_print_usage(void)
 "    --malloc-fill=<hexnumber>        fill malloc'd areas with given value\n"
 "    --free-fill=<hexnumber>          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"
+   );
 }
 
 
index 4d0c21d71e679d4192e6e6f2fc73e5cec7a66f51..154d4e1cd61c9a18ca0e12ed7ac6e721217015cf 100644 (file)
@@ -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 \
index 6c9a4742120e353e0314f178a4220af45f6ba0f1..ee3dfdbf2084c5bf8fdcae94ccb4e7df1495e041 100644 (file)
@@ -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=<name>             use the Valgrind tool named <name> [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=<number>         log messages to file descriptor [2=stderr]
     --log-file=<file>         log messages to <file>
     --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=<number>         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>    command to start debugger [/usr/bin/gdb -nw %f %p]
     --input-fd=<number>       file descriptor for input [0=stdin]
+    --dsymutil=no|yes         run dsymutil on Mac OS X when helpful? [no]
     --max-stackframe=<number> assume stack switch for SP changes larger
                               than <number> bytes [2000000]
     --main-stacksize=<number> set size of main thread's stack (in bytes)
                               [use current 'ulimit' value]
 
+  user options for Valgrind tools that replace malloc:
+    --alignment=<number>      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)
 
index ca5ded25f6244567e6070e49cbc176f0dd1268d6..599140b9cd706af655bb92ed5d6b0a8311f8b3aa 100644 (file)
@@ -1 +1,2 @@
 vgopts: --help --tool=none
+stdout_filter: filter_cmdline1
index 98dd177ef6b5411951cb468dad5ba92c67a787b7..dc147a448efbee924e4585d0c5e43c756fefaff4 100644 (file)
@@ -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=<name>             use the Valgrind tool named <name> [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=<number>         log messages to file descriptor [2=stderr]
     --log-file=<file>         log messages to <file>
     --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=<number>         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>    command to start debugger [/usr/bin/gdb -nw %f %p]
     --input-fd=<number>       file descriptor for input [0=stdin]
+    --dsymutil=no|yes         run dsymutil on Mac OS X when helpful? [no]
     --max-stackframe=<number> assume stack switch for SP changes larger
                               than <number> bytes [2000000]
     --main-stacksize=<number> set size of main thread's stack (in bytes)
                               [use current 'ulimit' value]
 
+  user options for Valgrind tools that replace malloc:
+    --alignment=<number>      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=<number>   level of sanity checking to do [1]
     --trace-flags=<XXXXXXXX>   show generated code? (X = 0|1) [00000000]
     --profile-flags=<XXXXXXXX> 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=<number>     show translation for basic block associated
                               with <number>'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)
 
index 84fc42ff62a656e669df1d9d76dca815285aa240..ba903f591798d22ae1d5d79c6a7d16da9c52152d 100644 (file)
@@ -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 (executable)
index 0000000..e6b58ae
--- /dev/null
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+perl -p -e 's/(set minimum alignment of heap allocations) \[(8|16)\]/$1 [...]/'
+