Add a crappy wrapper for access_extended(), one of the more ridiculous
syscalls I've had the displeasure of encountering. Due to its
ridiculousness, the wrapper misses a PRE_MEM_WRITE check and so can result
in false positives. The POST_MEM_WRITE update is present, though, so it
shouldn't cause subsequent problems. Fixes bug 200760.
Output tweaks:
- Always print a blank line after significant messages (eg. errors). This
makes the handling of blank lines much simpler.
- Don't print full stops at the end of messages. We mostly don't do it, so
I got rid of all the remaining ones I could find for consistency.
- Use --leak-check=full rather than --leak-check=yes, for consistency with
docs and other messages.
- Update partiallydefinedeq.stderr.exp2 for older changes.
This commit only updates the code. Test updates will follow shortly. (I'm
separating them so the code changes aren't swamped by the test changes in
the SVN logs.)
Callgrind: Fix printing of "Summary:" line in finish()
The global cost counters, which are used for printing the
summary line, where zeroed before in init_exec_state(), called
by unwind_thread().
Stack unwinding (i.e. unwind_thread) is also done at instrumentation
state changes, and there, we want the cost counters to be zeroed
(was fix for bug 150606). Do this explicitly now.
PS: The correct fix for bug 150606 is not to zero the cost counters
(we do not really want this at instrumentation state changes), but
to store the current counter values in a "last_instr_state_on_cost"
counter, and use this as the global cost counter on enter for functions
which are left but were not detected to be entered.
Fix dumping of call cost in tail recursion optimization
When tail recursion optimization is detected (i.e. a jump to the
beginning of the function without creating a new stack frame),
Callgrind collects this as real call (ie. calculates inclusive
call costs), but forgot to dump the call information (the call
type is still left as a jump).
Fixed by also dump call information if inclusive cost is >0.
* Patch from bug 198649 (callgrind_annotate doesn't cumulate counters)
When there were multiple call sites in one line, the aggregated
call count/cost numbers in the source annotation were wrong
* Callgrind often produces absolute file names.
Make it work with relative file names requested for annotation from
the command lines.
* More in sync with parser in KCachegrind: make summary line optional.
We can also use the "totals:" line for this.
* Count of numbers in summary can be smaller then number of events given
Julian Seward [Mon, 10 Aug 2009 18:59:54 +0000 (18:59 +0000)]
parse_type_DIE: push incomplete structure tyents on the type stack,
since gcc-4.4 on Fedora 11 will create DW_TAG_member entries within
it, and we need to have a plausible parent type on the stack.
Get rid of "-v" as short form of "--version".
Also, help text for dumps/instrumentation shows only the long
versions now. However, '-i on' or '-d dump now!' is still possible.
Julian Seward [Fri, 7 Aug 2009 15:46:56 +0000 (15:46 +0000)]
Tidy up of messaging:
* For all tools and the core, don't show statistics when -v is in
effect. Instead, try to restrict -v to mostly user-useful
stuff.
* A new flag --stats=no|yes [no] produces statistics output instead.
* Fix longstanding problem in that Memcheck's leak checker ran after
the core's error manager module shut down, thereby not showing use
counts of leak suppressions. This fixes #186790.
* As a consequence, the leak checker text output of Memcheck has
changed a bit -- leak check is done before the final error
summary is done (much more logical), and the output has been
tidied up a bit.
* Helgrind, Drd and Ptrcheck now also print "For counts of
detected and suppressed errors, rerun with: -v", which makes
them consistent with Memcheck in this regard. These are
filtered out by the regtest filter scripts.
For all tools except Memcheck, the regtests are unchanged. On
Memcheck regtests still fail due to rearrangements of the leak
checker output. This will be fixed by a followup commit.
Install all the new man pages. Include them in 'make dist' too (even if
BUILD_ALL_DOCS is false; we've built them anyway). Delete them with 'make
distclean' too (and FAQ.txt).
Add a manpage for cg_annotate. Now only valgrind-listener and cg_merge lack
a manpage, and they're so simple I can't be bothered doing ones for them
(they don't even have sections in the manual).
Also fixed a few minor things relating to manpages.
- Documented callgrind_{annotate,control} in the Callgrind manual chapter
and created man pages for them. Renamed the XML files in the process for
consistency.
- Added docs/xml/manpages-index.xml, which is just used as a convenient
single file to hang all the man pages off so they can be generated in a
single command.
- Added facility whereby manpage generation will attempt to find the
stylesheet in multiple places. This means I don't have to constantly edit
XSL_MAN_STYLE to build manpages on my machine.
- Changed vg-docs-path to start with $INSTALL instead of /usr/, because we
can't assume that's the installation dir.
- 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.