From: Nicholas Nethercote Date: Mon, 25 Jul 2005 23:18:44 +0000 (+0000) Subject: Clean up command-line args info in the manual and man page for 3.0.0 X-Git-Tag: svn/VALGRIND_3_0_0~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a269d9cb783610a33c2c85f4ace116c925da652e;p=thirdparty%2Fvalgrind.git Clean up command-line args info in the manual and man page for 3.0.0 release. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4259 --- diff --git a/docs/valgrind.1 b/docs/valgrind.1 index a6de9cc728..d058fd036a 100644 --- a/docs/valgrind.1 +++ b/docs/valgrind.1 @@ -1,7 +1,7 @@ .TH VALGRIND "1" "" "" .SH NAME -\fBvalgrind \fP- a memory debugger for x86-linux +\fBvalgrind \fP- a suite of tools for debugging and profiling programs .SH SYNOPSIS .nf @@ -11,8 +11,8 @@ .fi .SH DESCRIPTION -\fBvalgrind\fP is a flexible program for debugging and profiling Linux-x86 -executables. It consists of a core, which provides a synthetic x86 CPU +\fBvalgrind\fP is a flexible program for debugging and profiling Linux +executables. It consists of a core, which provides a synthetic CPU in software, and a series of "tools", each of which is a debugging or profiling tool. The architecture is modular, so that new tools can be created easily and without disturbing the existing structure. @@ -125,17 +125,25 @@ Specify the debugger to use with the --db-attach command. The default debugger is gdb. This option is a template that is expanded by \fBvalgrind\fP at runtime. \fB%f\fP is replaced with the executable's file name and \fB%p\fP is replaced by the process ID of the executable. + .TP .B +--demangle= [default: yes] +Enable or disable automatic demangling (decoding) of C++ names. Enabled by +default. When enabled, \fBvalgrind\fP will attempt to translate encoded +C++ procedure names back to something approaching the original. The +demangler handles symbols mangled by g++ versions 2.X and 3.X. +.TP +.B --error-limit= [default: yes] When enabled, \fBvalgrind\fP stops reporting errors after 30000 in total, or 300 different ones, have been seen. This is to stop the error tracking machinery from becoming a huge performance overhead in programs with many errors. + .TP .B - --gen-suppressions= [default: no] When enabled, \fBvalgrind\fP will pause after every error shown and print the line: @@ -172,6 +180,12 @@ Show help for all options, both for the core and for the selected tool. Show help for all options, both for the core and for the selected tool, including options for debugging \fBvalgrind\fP. +.TP +.B +--input-fd= [default: 0, stdin] +Specify the file descriptor to use for reading input from the user. This +is used whenever \fBvalgrind\fP needs to prompt the user for a decision. + .TP .B --log-file= @@ -180,6 +194,39 @@ specified file. In fact, the file name used is created by concatenating the text filename, ".pid" and the process ID, so as to create a file per process. The specified file name may not be the empty string. +.TP +.B +--log-file-exactly= +Just like \fB--log-file\fB, but the ".pid" suffix is not added. If you +trace multiple processes with Valgrind when using this option the log +file may get all messed up. + +.TP +.B +--log-fd= [default: 2, stderr] +Specifies that \fBvalgrind\fP should send all of its messages to +the specified file descriptor. The default, 2, is the standard error +channel (stderr). Note that this may interfere with the client's own +use of stderr. + +.TP +.B +--log-file-qualifier= +Specifies that \fBvalgrind\fB should send all of its messages to the +file named by the environment variable \fB$VAR\fB. This is useful when +running MPI programs. + +.TP +.B +--log-socket= +Specifies that \fBvalgrind\fP should send all of its messages to the +specified port at the specified IP address. The port may be omitted, +in which case port 1500 is used. If a connection cannot be made to +the specified socket, \fBvalgrind\fP falls back to writing output to +the standard error (stderr). This option is intended to be used in +conjunction with the \fBvalgrind-listener\fP program. For further details, +see section 2.3 of the user manual. + .TP .B --num-callers= [default=12] @@ -204,12 +251,25 @@ can be useful when working with programs with deeply-nested call chains. Run silently, and only print error messages. Useful if you are running regression tests or have some other automated test machinery. +.TP +.B +--show-below-main= [default: no] +When enabled, this option causes full stack backtraces to be emited, +including the part before \fBmain\fP in your program (subject to the +\fB--num-callers\fP option.) When disabled, only the part of the stack +backtrace up to and including main is printed. + .TP .B --suppressions= [default: $PREFIX/lib/\fBvalgrind\fP/default.supp] Specifies an extra file from which to read descriptions of errors to suppress. You may specify up to 10 additional suppression files. +.TP +.B +--time-stamp= [default: no] +When enabled, a time-stamp is added to all log messages. + .TP .B --tool= [default: memcheck] @@ -328,14 +388,6 @@ of \fBstrlen\fP. These versions of \fBstrlen\fP can cause spurious errors to be reported by \fBmemcheck\fP, so it's usually a good idea to leave this enabled. -.TP -.B ---cleanup= [default: yes] -\fBThis is a flag to help debug valgrind itself. It is of no use to -end-users\fP. When enabled, various improvments are applied to the -post-instrumented intermediate code, aimed at removing redundant value -checks. - .SH CACHEGRIND OPTIONS .TP @@ -425,107 +477,13 @@ have multiple stacks. .B --alignment= [default: 8] By default \fBvalgrind\fP's malloc, realloc, etc, return 8-byte aligned -addresses. These are suitable for any accesses on x86 processors. Some +addresses. These are suitable for any accesses on most processors. Some programs might however assume that malloc et al return 16- or more aligned memory. These programs are broken and should be fixed, but if this is impossible for whatever reason the alignment can be increased using this parameter. The supplied value must be between 8 and 4096 inclusive, and must be a power of two. -.TP -.B ---branchpred= [default: no] -This option enables the generation of static branch prediction hints. -In theory this allows the real CPU to do a better job of running the -generated code, but in practice it makes almost no measurable difference. -It may have a large effect on some x86 implementations. - -.TP -.B ---chain-bb= [default: yes] -Enables basic-block chaining. If basic-block chaining is disabled, -the synthetic CPU returns to the scheduler after interpreting each basic -block. With basic block chaining enabled, it can immediately proceed to -the next basic block. This almost always results in a performance gain, -so it is enabled by default. - -.TP -.B ---command-line-only= [default: no] -Normally, \fBvalgrind\fP will look for command-line options in the -following locations: -.RS -.TP -- The \fBvalgrind\fP command line -.TP -- The \fB\.valgrindrc\fP file in the invocation directory -.TP -- The \fB\.valgrindrc\fP file in users home directory -.TP -- The \fB$VALGRIND_OPTS\fP environment variable -.P - -When this option is enabled, \fBvalgrind\fP will only look at the command -line for options. -.RE - -.TP -.B ---demangle= [default: yes] -Enable or disable automatic demangling (decoding) of C++ names. Enabled by -default. When enabled, \fBvalgrind\fP will attempt to translate encoded -C++ procedure names back to something approaching the original. The -demangler handles symbols mangled by g++ versions 2.X and 3.X. - -.TP -.B ---dump-error= -After the program has exited, show gory details of the translation of -the basic block containing the \fB\fP'th error context. When -used with --single-step=yes, can show the exact x86 instruction causing -an error. This is all fairly dodgy and doesn't work at all if threads -are involved. - -.TP -.B ---exec= -Specify the executable to run. If this is specified, it takes precedence -over the \fByour-program\fP executable from the command-line. If this is -not specified, \fBvalgrind\fP searches the path for the \fByour-program\fP -executable, just like a regular shell would. - -.TP -.B ---input-fd= [default: 0, stdin] -Specify the file descriptor to use for reading input from the user. This -is used whenever \fBvalgrind\fP needs to prompt the user for a decision. - -.TP -.B ---log-fd= [default: 2, stderr] -Specifies that \fBvalgrind\fP should send all of its messages to -the specified file descriptor. The default, 2, is the standard error -channel (stderr). Note that this may interfere with the client's own -use of stderr. - -.TP -.B ---log-socket= -Specifies that \fBvalgrind\fP should send all of its messages to the -specified port at the specified IP address. The port may be omitted, -in which case port 1500 is used. If a connection cannot be made to -the specified socket, \fBvalgrind\fP falls back to writing output to -the standard error (stderr). This option is intended to be used in -conjunction with the \fBvalgrind-listener\fP program. For further details, -see section 2.3 of the user manual. - -.TP -.B ---optimise= [default: yes] -When enabled, various improvements are applied to the intermediate code, -mainly aimed at allowing the simulated CPU's registers to be cached in -the real CPU's registers over several simulated instructions. - .TP .B --pointercheck= [default: yes] @@ -561,27 +519,6 @@ segfaults at exit, you may find that --run-libc-freeres=no fixes that, although at the cost of possibly falsely reporting space leaks in libc.so. .RE -.TP -.B ---show-below-main= [default: no] -When enabled, this option causes full stack backtraces to be emited, -including the part before \fBmain\fP in your program (subject to the -\fB--num-callers\fP option.) When disabled, only the part of the stack -backtrace up to and including main is printed. - -.TP -.B ---single-step= [default: no] -When enabled, each x86 insn is translated separately into instrumented -code. When disabled, translation is done on a per-basic-block basis, -giving much better translations. This is needed when running -\fBvalgrind\fP under \fBvalgrind\fP. - -.TP -.B ---time-stamp= [default: no] -When enabled, a time-stamp is added to all log messages. - .TP .B --weird-hacks=hack1,hack2,\.\.\. @@ -609,71 +546,7 @@ Tell \fBvalgrind\fP to search for new memory mappings after an unknown .TP .B ---profile= [default: no] -When enabled, does crude internal profiling of \fBvalgrind\fP itself. This -is not for profiling your programs. Rather it is to allow the developers -to assess where \fBvalgrind\fP is spending its time. The tools must be -built for profiling for this to work. - -.TP -.B ---sanity-level= [default: 1] -Set the level of sanity checking to perform. This is used for debugging -\fBvalgrind\fP. Setting this to 2 or higher can cause more internal -sanity checks to be performed, but can slow your program down -appreciably. Setting this to 0 disables sanity checks. - -.TP -.B ---trace-codegen= -Produce lots of output showing exactly how \fBvalgrind\fP is translating -each basic block. The argument to this option is a 5-bit wide bitmask. -Each bit refers to a specific feature to trace. If the bit is 1, the -feature is traced. If it is 0, the feature is not traced. - -.RS -The traced features are: -.TP -Bit 1: basic-block disassembly -.TP -Bit 2: optimization phase -.TP -Bit 3: tool instrumentation -.TP -Bit 4: register allocation -.TP -Bit 5: final code generation -.RE - -.TP -.B ---trace-malloc= [default: no] -Enable or disable tracing of malloc, free and other memory-manager calls. - -.TP -.B ---trace-redir= [default: no] -Enable or disable tracing of function redirection. - -.TP -.B ---trace-sched= [default: no] -Enable or disable tracing of thread scheduling events. - -.TP -.B ---trace-signals= [default: no] -Enable or disable tracing of signal handling. - -.TP -.B ---trace-syscalls= [default: no] -Enable or disable tracing of system call intercepts. - -.TP -.B ---trace-symtab= [default: no] -Enable or disable tracing of symbol table reading. +Valgrind has several debugging options that are mostly of use to developers. Use \fB--help-debug\fB to show them. .SH SEE ALSO /usr/share/doc/\fBvalgrind\fP/html/manual.html diff --git a/docs/xml/manual-core.xml b/docs/xml/manual-core.xml index d3b890a03d..f0123ff678 100644 --- a/docs/xml/manual-core.xml +++ b/docs/xml/manual-core.xml @@ -609,6 +609,13 @@ categories. tool-vs-core version incompatibilities. + + -q --quiet + Run silently, and only print error messages. Useful if + you are running regression tests or have some other automated + test machinery. + + -v --verbose Be more verbose. Gives extra information on various @@ -618,13 +625,6 @@ categories. Repeating the flag increases the verbosity level. - - -q --quiet - Run silently, and only print error messages. Useful if - you are running regression tests or have some other automated - test machinery. - - --trace-children=no [default] @@ -634,6 +634,23 @@ categories. disabled by default. + + --track-fds=no [default] + --track-fds=yes + When enabled, Valgrind will print out a list of open + file descriptors on exit. Along with each file descriptor, + Valgrind prints out a stack backtrace of where the file was + opened and any details relating to the file descriptor such + as the file name or socket details. + + + + --time-stamp=no [default] + --time-stamp=yes + When enabled, Valgrind will precede each message with the + current time and date. + + --log-fd=<number> [default: 2, stderr] @@ -695,6 +712,23 @@ errors, e.g. Memcheck, but not Cachegrind. + + --xml=no [default] + --xml=yes + When enabled, output will be in XML format. This is aimed at + making life easier for tools that consume Valgrind's output as input, + such as GUI front ends. Currently this option only works with Memcheck + and Nulgrind. + + + + + --xml-user-comment=<string> [default=""] + Embeds an extra user comment string in the XML output. Only works + with --xml=yes is specified; ignored + otherwise. + + --demangle=no --demangle=yes [default] @@ -801,48 +835,6 @@ errors, e.g. Memcheck, but not Cachegrind. all used suppression records. - - --track-fds=no [default] - --track-fds=yes - When enabled, Valgrind will print out a list of open - file descriptors on exit. Along with each file descriptor, - Valgrind prints out a stack backtrace of where the file was - opened and any details relating to the file descriptor such - as the file name or socket details. - - - - --max-stackframe=<number> - [default=2000000] - - You may need to use this option if your program has large - stack-allocated arrays. Valgrind keeps track of your program's - stack pointer. If it changes by more than the threshold amount, - Valgrind assumes your program is switching to a different stack, - and Memcheck behaves differently than it would for a stack pointer - change smaller than the threshold. Usually this heuristic works - well. However, if your program allocates large structures on the - stack, this heuristic will be fooled, and Memcheck will - subsequently report large numbers of invalid stack accesses. This - option allows you to change the threshold to a different value. - - - You should only consider use of this flag if Valgrind's debug output - directs you to do so. In that case it will tell you the new - threshold you should specify. - - - In general, allocating large structures on the stack is a bad - idea, because (1) you can easily run out of stack space, - especially on systems with limited memory or which expect to - support large numbers of threads each with a small stack, and (2) - because the error checking performed by Memcheck is more effective - for heap-allocated data than for stack-allocated data. If you - have to use this flag, you may wish to consider rewriting your - code to allocate on the heap rather than on the stack. - - - --db-attach=no [default] --db-attach=yes @@ -910,6 +902,38 @@ errors, e.g. Memcheck, but not Cachegrind. alternative file descriptor from which to read input. + + --max-stackframe=<number> + [default=2000000] + + You may need to use this option if your program has large + stack-allocated arrays. Valgrind keeps track of your program's + stack pointer. If it changes by more than the threshold amount, + Valgrind assumes your program is switching to a different stack, + and Memcheck behaves differently than it would for a stack pointer + change smaller than the threshold. Usually this heuristic works + well. However, if your program allocates large structures on the + stack, this heuristic will be fooled, and Memcheck will + subsequently report large numbers of invalid stack accesses. This + option allows you to change the threshold to a different value. + + + You should only consider use of this flag if Valgrind's debug output + directs you to do so. In that case it will tell you the new + threshold you should specify. + + + In general, allocating large structures on the stack is a bad + idea, because (1) you can easily run out of stack space, + especially on systems with limited memory or which expect to + support large numbers of threads each with a small stack, and (2) + because the error checking performed by Memcheck is more effective + for heap-allocated data than for stack-allocated data. If you + have to use this flag, you may wish to consider rewriting your + code to allocate on the heap rather than on the stack. + + + @@ -940,8 +964,8 @@ Addrcheck), the following options apply. - - Rare Options + + Uncommon Options These options apply to all tools, as they affect certain obscure workings of the Valgrind core. Most people won't need @@ -1027,131 +1051,39 @@ Addrcheck), the following options apply. the same functionality. - - - - - -Debugging Valgrind Options - -There are also some options for debugging Valgrind itself. -You shouldn't need to use them in the normal run of things. -Nevertheless: - - - - --single-step=no - [default] - --single-step=yes - When enabled, each instruction is translated separately - into instrumented code. When disabled, translation is done - on a per-basic-block basis, giving much better - translations. This option is very useful if your program expects - precise exceptions (if it, for example, inspects or modifies register - state from within a signal handler). - + --show-emwarns=no [default] + --show-emwarns=yes + When enabled, Valgrind will emit warnings about its CPU emulation + in certain cases. These are usually not interesting. - --optimise=no - --optimise=yes [default] - When enabled, various improvements are applied to the - intermediate code, mainly aimed at allowing the simulated - CPU's registers to be cached in the real CPU's registers over - several simulated instructions. - + --smc-check=none + --smc-check=stack [default] + --smc-check=all + This option controls Valgrind's detection of self-modifying code. + Valgrind can do no detection, detect self-modifying code on the stack, + or detect self-modifying code anywhere. Note that the default option + will catch the vast majority of cases, as far as we know. Running with + all will slow Valgrind down greatly + (but running with none will rarely + speed things up, since very little code gets put on the stack for most + programs). + - - --profile=no - --profile=yes [default] - When enabled, does crude internal profiling of Valgrind - itself. This is not for profiling your programs. Rather it - is to allow the developers to assess where Valgrind is - spending its time. The tools must be built for profiling for - this to work. - - - - --trace-syscalls=no - [default] - --trace-syscalls=yes - Enable/disable tracing of system call intercepts. - - - - --trace-signals=no - [default] - --trace-signals=yes - Enable/disable tracing of signal handling. - - - - --trace-sched=no - [default] - --trace-sched=yes - Enable/disable tracing of thread scheduling events. - - - - --trace-pthread=none - [default] - --trace-pthread=some - --trace-pthread=all - Specifies amount of trace detail for pthread-related - events. - - - - --trace-symtab=no - [default] - --trace-symtab=yes - Enable/disable tracing of symbol table reading and line - number info reading. - + + - - --trace-cfi=no - [default] - --trace-cfi=yes - Enable/disable tracing of call-frame-info reading. - Call-frame-info (CFI) is information inserted by compilers - which describes the relationship between adjacent call frames. - On architectures which by default do not use a frame pointer, - such as AMD64, this information is essential for creating stack - snapshots. - - - --trace-malloc=no - [default] - --trace-malloc=yes - Enable/disable tracing of malloc/free (et al) - intercepts. - - - - --trace-codegen=XXXXX - [default: 00000] - Enable/disable tracing of code generation. Code can be - printed at five different stages of translation; each - X element must be 0 or - 1. - + +Debugging Valgrind Options - - --dump-error=<number> - [default: inactive] - After the program has exited, show gory details of the - translation of the basic block containing the <number>'th - error context. When used with - --single-step=yes, can show - the exact instruction causing an error. This is all - fairly dodgy and doesn't work at all if threads are - involved. - +There are also some options for debugging Valgrind itself. +You shouldn't need to use them in the normal run of things. If you +wish to see the list, use the --help-debug +option. - diff --git a/memcheck/docs/mc-manual.xml b/memcheck/docs/mc-manual.xml index 8d9e03f48f..744255b02c 100644 --- a/memcheck/docs/mc-manual.xml +++ b/memcheck/docs/mc-manual.xml @@ -62,15 +62,18 @@ Memcheck can detect the following problems: --leak-check=no + --leak-check=summary [default] - --leak-check=yes + --leak-check=full When enabled, search for memory leaks when the client program finishes. A memory leak means a malloc'd block, which has not yet been free'd, but to which no pointer can be found. Such a block can never be free'd by the program, - since no pointer to it exists. Leak checking is disabled by - default because it tends to generate dozens of error - messages. + since no pointer to it exists. If set to + summary, it says how many leaks occurred. + If set to all, it gives details of each + individual leak. + @@ -182,15 +185,6 @@ Memcheck can detect the following problems: enabled. - - --cleanup=no - --cleanup=yes [default] - This is a flag to help debug valgrind itself. - It is of no use to end-users. When enabled, various - improvments are applied to the post-instrumented intermediate - code, aimed at removing redundant value checks. - -