Using and understanding the Valgrind core
--gen-suppressions=<yes|no|all> [default:
no]
When set to
yes
, Valgrind will pause after every error shown and print the line:
---- Print suppression ? --- [Return/N/n/Y/y/C/c] ----
The prompt’s behaviour is the same as for the
--db-attach
option (see below).
If you choose to, Valgrind will print out a suppression for this error. You can then cut and paste it into a suppression
file if you don’t want to hear about the error in the future.
When set to
all
, Valgrind will print a suppression for every reported error, without querying the user.
This option is particularly useful with C++ programs, as it prints out the suppressions with mangled names, as required.
Note that the suppressions printed are as specific as possible. You may want to common up similar ones, by adding
wildcards to function names, and by using frame-level wildcards. The wildcarding facilities are powerful yet flexible,
and with a bit of careful editing, you may be able to suppress a whole family of related errors with only a few
suppressions.
Sometimes two different errors are suppressed by the same suppression, in which case Valgrind will output the
suppression more than once, but you only need to have one copy in your suppression file (but having more than
one won’t cause problems). Also, the suppression name is given as
<insert a suppression name here>
;
the name doesn’t really matter, it’s only used with the
-v
option which prints out all used suppression records.
--db-attach=<yes|no> [default:
no]
When enabled, Valgrind will pause after every error shown and print the line:
---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ----
Pressing
Ret
, or
N Ret
or
n Ret
, causes Valgrind not to start a debugger for this error.
Pressing
Y Ret
or
y Ret
causes Valgrind to start a debugger for the program at this point. When you have finished
with the debugger, quit from it, and the program will continue. Trying to continue from inside the debugger doesn’t
work.
Note: if you use GDB, more powerful debugging support is provided by the
--vgdb= yes
or
full
value.
This activates Valgrind’s internal gdbserver, which provides more-or-less full GDB-style control of the application:
insertion of breakpoints, continuing from inside GDB, inferior function calls, and much more.
C Ret
or
c Ret
causes Valgrind not to start a debugger, and not to ask again.
--db-command=<command> [default:
gdb -nw %f %p]
Specify the debugger to use with the
--db-attach
command. The default debugger is GDB. This option is a
template that is expanded by Valgrind at runtime.
%f
is replaced with the executable’s file name and
%p
is replaced
by the process ID of the executable.
This specifies how Valgrind will invoke the debugger. By default it will use whatever GDB is detected at build time,
which is usually
/usr/bin/gdb
. Using this command, you can specify some alternative command to invoke the
debugger you want to use.
The command string given can include one or instances of the
%p
and
%f
expansions. Each instance of
%p
expands to
the PID of the process to be debugged and each instance of
%f
expands to the path to the executable for the process to
be debugged.
Since
<command>
is likely to contain spaces, you will need to put this entire option in quotes to ensure it is correctly
handled by the shell.
14
Содержание BBV
Страница 176: ...Valgrind FAQ Release 3 8 0 10 August 2012 Copyright 2000 2012 Valgrind Developers Email valgrind valgrind org ...
Страница 177: ...Valgrind FAQ Table of Contents Valgrind Frequently Asked Questions 1 ii ...
Страница 302: ...README mips based on newer GCC versions if possible 95 ...
Страница 303: ...GNU Licenses ...
Страница 304: ...GNU Licenses Table of Contents 1 The GNU General Public License 1 2 The GNU Free Documentation License 8 ii ...