- Make other integer CLO macros more correct, as I did for VG_NUM_CLO in the
last commit.
- Add a VG_DBL_CLO for fractional arguments.
- Make Massif's --threshold and --peak-inaccuracy arguments fractional.
Add four 'strtoll' variants, which are like 'atoll' but let you detect if
the string converted wasn't entirely numeric. Using them for numeric
command-line options -- previously if you had a option "--foo=<n>", where
<n> is supposed to be an integer, then "--foo=blah" would be interpreted as
"--foo=0", because the "blah" would be converted to zero and the remaining
chars wouldn't be noticed.
Fixed an incorrect command-line option in two massif tests that this change
exposed.
Julian Seward [Sat, 10 Nov 2007 22:50:13 +0000 (22:50 +0000)]
Followup to r7105: stop gcc complaining about violations of ANSI C
aliasing rules by casting through (char*) as an intermediate type,
rather than through (void*). This seems at least moderately
justifiable since the ANSI C standard explicitly says that any object
may be accessed through a char pointer.
Julian Seward [Sat, 10 Nov 2007 20:21:11 +0000 (20:21 +0000)]
Include omega.h in the distribution tarball, else building from the
tarball fails. As it stands omega.h is not installed into
$prefix/include/valgrind, so cannot be used in client requests.
Perhaps it should be.
Changed Massif to record the 'slop' heap bytes caused by rounding asked-for
sizes up to a multiple of 8 (or whatever --alignment is). This is combined
with the "admin" bytes, resulting in the "extra" bytes. Added
VG_(malloc_usable_size) to the tool interface to support this.
Julian Seward [Fri, 9 Nov 2007 23:29:46 +0000 (23:29 +0000)]
Merge (from branches/THRCHECK) r7043:
Allow a test to have any number of .stderr.exp* files, so long as at
least one is found. In fact the comments in the code that claimed
that .stderr.exp[0-9] are the only ones allowed were misleading;
.stderr.exp* has always been allowed. The only functional change here
is to mandate that at least one such file exists; prior to the change
the script mandated that at least a .stderr.exp (with no other suffix)
file existed.
Purpose is to allow collections of .stderr.exp files with suffixes
arranged in some meaningful way, eg, foo.stderr.exp-glibc25-amd64.
This might help in making testsuites more maintainable when there
have to be multiple .stderr.exp files. Naming them merely as
.stderr.exp1, .stderr.exp2, etc, makes it impossible to remember
what the differences between the files actually is.
Julian Seward [Fri, 9 Nov 2007 23:21:44 +0000 (23:21 +0000)]
Merge (from branches/THRCHECK) the following two changes to the core-tool
interface:
r6805: Modify two thread-notification events in the core-tool
interface. This removes track_post_thread_create and
track_post_thread_join. The core can only see low level thread
creation and exiting, and has no idea about pthread-level concepts
like "pthread_create" and "pthread_join", so these are a bit
ambiguous.
Replace them with track_pre_thread_ll_create, which is notified before
a new thread makes any memory references, and
track_pre_thread_ll_exit, which is notified just before the new thread
exits, that is, after it has made its last memory reference.
r6823: Core-tool interface: give 'needs_tool_errors' an extra Boolean
indicating whether or not the core should print thread id's on error
messages.
Julian Seward [Fri, 9 Nov 2007 23:13:22 +0000 (23:13 +0000)]
Merge (from branches/THRCHECK) r6804:
Split the scheduler initialisation into two phases, for reasons I
can't exactly remember. But I think it was so that the tool can be
told of the initial thread's TID before it is notified of any initial
address range permissions. Or something like that.
Julian Seward [Fri, 9 Nov 2007 23:09:50 +0000 (23:09 +0000)]
Merge r6806 from branches/THRCHECK:
Fix longstanding error in the amd64-linux function-wrapping macros:
protect the caller's red zone across the hidden call. All rather
nasty as explained in big comment.
Julian Seward [Fri, 9 Nov 2007 23:02:28 +0000 (23:02 +0000)]
Merge (from branches/THRCHECK) the following amd64-linux stack unwind
kludges^H^H^H^H^H^H^Henhancements:
r6802: For VG_(record_ExeContext) et al, add a new parameter
(first_ip_delta) which is added to the initial IP value before the
stack is unwound. A safe value to pass is zero, which causes the
existing behaviour to be unchanged. This is a kludge needed to work
around the incomplete amd64 stack unwind info in glibc-2.5's clone()
routine.
r7059: Add a last-ditch heuristic-hack to the amd64-linux stack
unwinder, which is used when all other methods fail. Seems like GDB
has something similar.
Julian Seward [Fri, 9 Nov 2007 12:30:36 +0000 (12:30 +0000)]
Add Bryan Meredith's Omega tool as an experimental tool. Maintainer
is Rich Coe. Also, a minor mod to Makefile.install.am to handle tool
names with dashes in.
Fix a Makefile issue that I think caused automated testing to fail on
'alvis' last night. I don't no why it worked on the other machines, must be
an automake version thing.
Fix 64-bit Massif breakage, caused by problems with integer arithmetic on
values of different signs and sizes that only a C language lawyer would
spot.
Merged the MASSIF2 branch to the trunk. Main changes:
- ms_main.c: completely overhauled.
- massif/tests/*: lots of them now.
- massif/perf/: added.
- massif/hp2ps: removed. No longer used.
- vg_regtest: renamed the previously unused "posttest" notion to "post".
Using it for checking ms_print's output.
Although the code has changed dramatically, as has the form of the tool's
output, the information presented in the output is basically the same,
although it's now (hopefully) much more useful. So the tool name is
unchanged.
callgrind_control: Fix behavior with callgrind runs of another user
callgrind_control uses files /tmp/callgrind.info.* to be able to
locate running callgrind processes. These files can be read only by
the user which started callgrind. The callgrind_control script
did not check for "permission denied" on opening these files, which
resulted in some unexpected errors. Now, it is checked whether
the "open" was successful, and if not, we skip the according callgrind
process.
callgrind: Use directory in debug info when available
Prepend the file name of a source file with the directory
if that is available. This not only gets rid of problems with the
same file name used in different paths of a project, but lets
the annotation work out of the box without having to specify any
source directory.
Works both with callgrind_annotate and KCachegrind without any
changes there.
Inspired by Nick's change to cachegrind doing the same thing
in r6839 (and gets rid of a FIXME in the source)
Split the OSet interface into two parts: "OSetGen_", which is the existing
interface and provides full power; and "OSetWord_", which is an
easier-to-use interface for if you just want to store words.
ppc32-linux signal handling: don't place the sigframe return stub on
the stack; instead use a stub in m_trampoline.S. This makes it
possible to deliver signals on non-executable stacks, and makes the
behaviour consistent with x86-linux and amd64-linux.
Julian Seward [Wed, 29 Aug 2007 09:11:35 +0000 (09:11 +0000)]
Valgrind-side changes to track vx1786 (which was: Support x86 $int
0x40 .. 0x43 instructions on Linux. Apparently these generate a
segfault and then restart the instruction.)
Julian Seward [Tue, 28 Aug 2007 06:05:20 +0000 (06:05 +0000)]
Merge, from CGTUNE branch, a cleaned up version of r6742:
Another optimisation: allow tools to provide a final_tidy function
which they can use to mess with the final post-tree-built IR before it
is handed off to instruction selection.
In memcheck, use this to remove redundant calls to
MC_(helperc_value_check0_fail) et al. Gives a 6% reduction in code
size for Memcheck on x86 and a smaller (3% ?) speedup.
Julian Seward [Mon, 27 Aug 2007 10:46:39 +0000 (10:46 +0000)]
This module supplies various replacement functions, amongst them a
replacement for index/strchr in ld.so. Unfortunately the replacement
functionality was actually rindex/strrchr and amazingly it has taken
about 2.5 years for anyone to notice.
This fixes the x86-linux case; ppc32-linux and ppc64-linux fixes to
follow.