Using and understanding the Valgrind core
--input-fd=<number> [default:
0, stdin]
When using
--db-attach=yes
or
--gen-suppressions=yes
, Valgrind will stop so as to read keyboard
input from you when each error occurs. By default it reads from the standard input (stdin), which is problematic for
programs which close stdin. This option allows you to specify an alternative file descriptor from which to read input.
--dsymutil=no|yes [no]
This option is only relevant when running Valgrind on Mac OS X.
Mac OS X uses a deferred debug information (debuginfo) linking scheme. When object files containing debuginfo
are linked into a
.dylib
or an executable, the debuginfo is not copied into the final file. Instead, the debuginfo must
be linked manually by running
dsymutil
, a system-provided utility, on the executable or
.dylib
. The resulting
combined debuginfo is placed in a directory alongside the executable or
.dylib
, but with the extension
.dSYM
.
With
--dsymutil=no
, Valgrind will detect cases where the
.dSYM
directory is either missing, or is present but
does not appear to match the associated executable or
.dylib
, most likely because it is out of date. In these cases,
Valgrind will print a warning message but take no further action.
With
--dsymutil=yes
, 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
--dsymutil=yes
, then there is never any need
to run
dsymutil
manually or as part of your applications’s build system, since Valgrind will run it as necessary.
Valgrind will not attempt to run
dsymutil
on any executable or library in
/usr/
,
/bin/
,
/sbin/
,
/opt/
,
/sw/
,
/System/
,
/Library/
or
/Applications/
since
dsymutil
will always fail in such situations. It fails both
because the debuginfo for such pre-installed system components is not available anywhere, and also because it would
require write privileges in those directories.
Be careful when using
--dsymutil=yes
, since it will cause pre-existing
.dSYM
directories to be silently deleted
and re-created. Also note that
dsymutil
is quite slow, sometimes excessively so.
--max-stackframe=<number> [default:
2000000]
The maximum size of a stack frame. If the stack pointer moves by more than this amount then Valgrind will assume
that the program is switching to a different stack.
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 option 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 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 also 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 option, you may wish to consider rewriting your code to allocate on the
heap rather than on the stack.
15
Содержание 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 ...