- Rejigged Lackey's manual
- Made it count calls to main() by default, since _dl_runtime_resolve() no
longer appears to exist.
- A couple of other minor Lackey things.
Added documentation for --ignore-ranges. It's not very good, though, if
anyone can explain clearly why it's useful and wants to add that information
that would be helpful.
- 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.
Don't wrap the "Command:" line, as doing so makes cutting-and-pasting the
command difficult. Also, when wrapping I was failing to factor in the
escape chars needed for chars like ' '; now I don't need to. And this
means the 'long-command' test is no longer necessary. In other words,
favour utility and simplicity over aesthetics.
Also, the "Command:" line wasn't being wrapped in <line></line> in XML
output. It now is.
Tom Hughes [Mon, 3 Aug 2009 14:39:54 +0000 (14:39 +0000)]
Ignore structure members with no location - thiscan happen with static
const members in C++ code which are compile time constants that do no
exist in the class. They're not of any interest to us so we ignore them.
Julian Seward [Mon, 3 Aug 2009 13:47:04 +0000 (13:47 +0000)]
Patch to remember/restore CFA state on DW_CFA_{remember,restore}_state.
In addition to that it fixes a bug in restore_ctx handling, where it
was restoring the state from the same stack level in restore_ctx
context as is current in ctx, which is wrong, the CIE likely has no
DW_CFA_remember_state at all, while the FDE could have one.
(Jakub Jelinek). This is #200029, patch in comment #2.
With the recent VG_(message) change,
VALGRIND_{PRINTF,PRINTF_BACKTRACE,INTERNAL_PRINTF} were no longer appending
newlines. This meant that --trace-malloc=yes spewed everything onto a
single line, among other things.
Rather than adding the newline back in, I chose to offically change their
behaviour to not add the newlines, as this is more flexible (and the reason
for the underlying VG_(message) change). I updated all the relevant places
I could find.
Julian Seward [Sun, 2 Aug 2009 12:21:31 +0000 (12:21 +0000)]
Reinstating a heavily modified version of r10402. This is to do
with #190429.
This patch (originally from Jakub Jelinek) makes the redir of strlen
in ld.so on amd64-linux ld.so mandatory, but only for glibc 2.10 and
above. For glibc-2.2 (our earliest supported version) to glibc-2.9
it is still optional.
Also, makes more verbose, the message that is printed if a mandatory
ld.so redirection on Linux cannot be set up.
Bart Van Assche [Sun, 2 Aug 2009 07:46:43 +0000 (07:46 +0000)]
Cleaned up DRD's Linux suppression patterns:
- Grouped the three suppression patterns for ld into a single suppression
pattern.
- Assigned more descriptive names to the suppression patterns.
- Improved suppression pattern documentation.
- Removed suppression patterns that were added before VEX supported atomic
instructions and that are no longer necessary with the current version
of VEX.
Added an output variant for the pth_cancel_locked regression test.
Apparently when canceling a thread waiting inside pthread_cond_wait()
on Linux the specified mutex is left unlocked while on Darwin the
mutex specified in the pthread_cond_wait() call is reacquired before
the thread is terminated.
Implemented a more systematic approach for intercepting POSIX threads
functions: for each function name to intercept, intercept the function
name itself, the function name with @* appended (versioned symbols on
Linux) and the function name with $* appended (versioned symbols on
Darwin). Updated filter_stderr such that symbol versions are removed.
Updated the expected output files that contain names of intercepted
functions.
* VG_(find_seginfo): incrementally rearrange the DebugInfo list, like
most of the other list-searching functions do.
* rename all VG_(*seginfo*) functions exported from m_debuginfo to
VG_(*DebugInfo*). "seginfo" was a historical name which was mostly
but not completely, done away with some time back.
Don't instrument any code in ld.so. Doing so merely generates a large
number of races which have to be expensively suppressed, so it's
better not to do so.
Only consider two error contexts as equivalent if the contexts have another
type than "data race error" or if both data race error contexts refer to the
same access type and the same access size.
We currently use a mix of <option> and <computeroutput> tags for command
line options. This commit changes them to all <option>.
Also make consistent how options with multiple names (eg. -h --help) are
shown.
Also, remove section describing --help and --version in Callgrind's chapter;
these aren't necessary and are presumably a hangover from when Callgrind was
a separate tool.
Tom Hughes [Wed, 29 Jul 2009 11:09:01 +0000 (11:09 +0000)]
Improve futex system call support. Patch from BZ#201757 which I have
attempted to cross check against current kernel code. Reading the
futex system call code mostly just made my head hurt however...
Don't include "how to write a tool" in the user manual -- it's in the tech
docs, and the chapter/section numbering doesn't match the rest of the
numbering in the user manual.
Also change some of the names of the links in that file to match the
filename.
Started overhauling the documentation:
- There were detailed descriptions of all the tools in the Quick Start
Guide, the Manual introduction, and the start of each tool chapter. To
avoid duplication/overlap, I removed these altogether from the Quick Start
Guide, and shortened them in the intro.
- Improved the description of what errors Memcheck can find.
- Made all tool chapters start with "Overview" section, for consistency.
- Made the "run with --tool=XXX" bit consistent in each tool chapter.
- Made all tool chapter titles match the description given when running them.
- Added BBV to the User Manual intro.
- Generally clarified, updated, and future-proofed various bits of text in
the Quick Start Guide and User Manual introduction.
Also:
- Changed Nulgrind's start-up description to "the minimal Valgrind tool".
Improve checking for pthread_mutex_cond operations: implement a check
for consistent binding between the CV and the mutex, as specified by
POSIX. Add commented out code for some other checks that could be
done but aren't, as they'd give false positives.
Tom Hughes [Mon, 27 Jul 2009 23:09:42 +0000 (23:09 +0000)]
Make sure the x86 direction flag is cleared again if we set it as part
of a test, as the x86 requires it to be clear when any function is called
and gcc 4.3.0 and later rely on that. Fixes #201708.
Implemented type checking for reader-writer synchronization
objects: complain upon attempts to use a POSIX rwlock where a
user-defined rwlock is expected and vice versa.
- Moved printing the thread number to the function that prints the
preamble.
- Matching suppression types with error contexts does now work properly.
- Cleanup: added more comments, renamed some functions, removed an unused
function argument.
Made the error reporting behavior of DRD similar to that of other
Valgrind tools: if the same kind of error has been detected a second
time with an identical call stack, count it as an error but do not print
it a second time. The total number of detected errors remains unchanged
but the number of error contexts is now reported correctly.
Fixed a bug in the code for reading suppression files: the line numbers
reported in error messages were not correct. As an example, the following
output was produced before this patch (not correct):
$ ./vg-in-place --tool=helgrind --num-callers=1 /bin/true
...
FATAL: in suppressions file ".in_place/default.supp" near line 893:
suppression must contain at least one location line which is not "..."
exiting now.
$ ./vg-in-place --tool=drd --num-callers=1 /bin/true
FATAL: in suppressions file ".in_place/default.supp" near line 475:
suppression must contain at least one location line which is not "..."
exiting now.
After having applied this patch the above commands display line numbers
1104 and 619, referring to the first suppression pattern containing
three dots for the topmost stack frame, as expected.
Add a new output file for tc12_rwl_trivial. It unfortunately can't be
the same as the glibc one, because glibc is broken in the sense that
it doesn't return an error code for an attempt to unlock a not-locked
rwlock, and the returned error code affects Helgrind's output.
Re-check the symbol names for all pthread intercepts, to find all Linux
and Darwin versions. Add versions for Darwin names that are not so far
supported. Add support for sem_open and sem_close.