122 Commits

Author SHA1 Message Date
Nicholas Nethercote
5ef4243598 Default to using --leak-check=summary.
MERGED FROM CVS HEAD



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3312
2005-03-12 20:38:13 +00:00
Julian Seward
0356d27ca6 Merge in changes from the 2.4.0 line. This basically brings in the
overhaul of the thread support.  Many things are now probably broken,
but at least with --tool=none, simple and not-so-simple threaded and
non-thread programs work.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3265
2005-03-10 23:59:00 +00:00
Julian Seward
7c542ccd39 Add new files resulting from merging in the 2.4.0 line. Many of these
seem to be simply duplication of the x86 instruction set tests into
the addrcheck and helgrind trees.  I'm not sure what this duplication
achieves.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3264
2005-03-10 23:23:45 +00:00
Julian Seward
a2bac50f58 Un-break regtests (again)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3209
2004-12-20 05:44:49 +00:00
Julian Seward
8c0a061245 Update, and thereby unbreak trivial regtest breakage.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3199
2004-12-14 09:18:57 +00:00
Nicholas Nethercote
ce2585d447 Changed message at the top of files, and the startup message, and the
string in valgrind.pc.in, so that they describe Valgrind as a "dynamic
binary instrumentation framework", and don't mention platforms at all.  

I had to tweak the regtest filters a bit for this.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3178
2004-12-01 14:14:42 +00:00
Nicholas Nethercote
10b4595add Added beginnings of an AMD64 port, so lots of new files and directories.
It compiles, but aborts immediately if you try to run it.

I didn't include ldt.c;  I'm not sure how the LDT is used on AMD64.  It can be
added later if necessary.

While doing this, did some 64-bit cleanness fixes:
- Added necessary intermediate casts to ULong to avoid warnings when converting
  ThreadId to void* and vice versa, in vg_scheduler.c.
- Fixed VALGRIND_NON_SIMD_CALL[0123] to use 'long' as the return type.
- Fixed VALGRIND_PRINTF{,BACKTRACE} to use unsigned longs instead of unsigned
  ints, as needed.
- Converted some offsets in vg_symtab2.h from "Int" to "OffT".
- Made strlen, strncat, etc, use SizeT instead of 'unsigned int' for the length
  parameter.
- Couple of other minor things.

I had to insert some "#ifdef __amd64__" and "#ifndef __amd64__" guards in
places.  In particular, in vg_mylibc.c, some of our syscall wrappers aren't
appropriate for AMD64 because the syscall numbering is a bit different in
places.  This difference will have to be abstracted out somehow.

Also rewrote the sys_fcntl and sys_fcntl64 wrappers, as required for AMD64.

Also moved the ipc wrapper into x86, since it's not applicable for
AMD64.  However, it is applicable (I think) for ARM, so it would be nice
to work out a way to share syscall wrappers between some, but not all,
archs.  Hmm.  Also now using the real IPC constants rather than magic
numbers in the wrapper.

Other non-AMD64-related fixes:
- ARM: fixed syscall table by accounting for the fact that syscall
  numbers don't start at 0, but rather at 0x900000.
- Converted a few places to use ThreadId instead of 'int' or 'Int' for
  thread IDs.
- Added both AMD64 and ARM (which I'd forgotten) entries to valgrind.spec.in.
- Tweaked comments in various places.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3136
2004-11-29 13:54:10 +00:00
Nicholas Nethercote
4399d9700f Added beginnings of an ARM port, to the point where it compiles. It does not
run, though.  There are lots of stubs to be filled in.  (The asm ones currently
just have "swi" in them, which seems to cause seg faults.) 

Also, some of the macros are decided dubious, especially:

  ARCH_* are bogus
  SYSCALL_RET is bogus
  PLATFORM_SET_SYSCALL_RESULT is bogus
  not sure about SET_SYSCALL_RETVAL
  FIRST_STACK_FRAME et al -- bogus?
  VG_MAX_JUMPS ?

And in stage2.lds, the 0x8048000 is almost certainly wrong


This required some tweakings of the core:
- some of the vki_*.h kernel types were fixed up

- had to disable the AM_PROG_CC_C_O macro in configure.in, because automake
  (autoconf?) didn't like it...

- some "#ifdef __x86__" guards were introduced, for nasty x86 things I don't
  yet know how to factor out (trampoline page muck, sysinfo page muck).

- fixed a minor stupidity in vg_proxylwp.c.

- moved the ptrace wrapper into the x86-linux part

- had to change the intercept mangling scheme, to use 'J' instead of '$' as the
  escape char because GCC didn't like '$'.  This is all very dubious, and only
  works because none of our intercepted symbols contains a 'J'.  To be fixed up
  ASAP.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3120
2004-11-26 19:34:36 +00:00
Nicholas Nethercote
10c3e3c927 Arch-abstraction:
- Added a hacky mechanism which prevents the regtest script from entering
directories for other architectures.  (Eg. when running on x86/, it won't enter
a ppc/ subdir.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3045
2004-11-18 18:21:56 +00:00
Nicholas Nethercote
3b4dc0bdba Generalised the reg test script again: replaced the "cpu_test" line,
which caused the test to be skipped if the CPU type wasn't appropriate,
with a "prereq" line, which specifies a command that must succeed before
the test is run.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3041
2004-11-18 12:48:17 +00:00
Nicholas Nethercote
a2d1e021a4 Generalised reg test script: instead of having a "delete:" line, for removing
files once a test has completed, we have a "cleanup:" line, which specifies a
cleanup command.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3039
2004-11-18 11:57:00 +00:00
Nicholas Nethercote
f1f1e2ffe3 Arch-abstraction:
- Change regtest script to print a message if a test is skipped due to the cpu
  being of the wrong type.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2803
2004-10-19 16:56:41 +00:00
Nicholas Nethercote
f4d320e3c4 Arch-abstraction:
- Rewrote tests/cputest.c so that it can apply to different kinds of
  processors.  The idea being that any arch-specific tests have a cpu_test:
  label in their .vgtest file, so they'll only get executed if the right
  machine is being used.
- Rewrote a bunch of .vgtest files accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2802
2004-10-19 16:29:30 +00:00
Nicholas Nethercote
2a1a81befa Arch-abstraction: arch-neutralise the startup message.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2667
2004-09-06 15:34:37 +00:00
Nicholas Nethercote
854d2ec10e Fix for bug #78048.
Problem was that the malloc-replacing tools (memcheck, addrcheck, massif,
helgrind) would assert if a too-big malloc was attempted.  Now they return 0 to
the client.  I also cleaned up the code handling heap-block-metadata in Massif
and Addrcheck/Memcheck a little.

This exposed a nasty bug in VG_(client_alloc)() which wasn't checking if
find_map_space() was succeeding before attempting an mmap().  Before I added
the check, very big mallocs (eg 2GB) for Addrcheck were overwriting the client
space at address 0 and causing crashes.

Added a regtest to all the affected skins for this.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2462
2004-07-10 14:56:28 +00:00
Nicholas Nethercote
9ce21c9e69 Fixed up various command line option scenarios:
- If no tool is specified, V now gives a short message and a list of
    available tools.  This was meant to happen previously, but a bug prevented
    it from working properly;  it gave the usage message instead.

  - If a bad option is given, V now gives a short message rather than the full
    --help.  This make V consistent with all other programs I looked at.

  - Now returning 0 when you do 'valgrind --help' and 'valgrind --version'
    as other programs do.

  - Removed VG_(startup_logging)() and VG_(shutdown_logging)() as they were
    empty and have been for a long time (always?).

  - Added various tests for these scenarios.  Had to change the regtest
    script slightly to allow for malformed command lines.

This addresses bug (wishlist) #82999.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2418
2004-06-15 10:54:40 +00:00
Nicholas Nethercote
2fc96dcc06 Add a "delete:" line to the regression test .vgtest files, to clean up any file
created by the test.  Added appropriate lines to the Cachegrind and Massif
tests.  Should prevent large numbers of files clogging up directories.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2372
2004-04-17 17:25:08 +00:00
Tom Hughes
cd101bf7b2 Extended instruction test system to handle x87 floating point instructions
and started working on adding tests for the x87 instruction set.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2338
2004-03-27 18:02:37 +00:00
Tom Hughes
762af5a827 Strip _nocancel from glibc stack traces so that __open_nocancel etc
look like open as seen in traces from older glibcs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2335
2004-03-22 19:57:41 +00:00
Tom Hughes
4ab4db0743 Filter out the ": core dumped" message from test results as the user
running the tests might have a ulimit set that prevents the core dumps.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2327
2004-03-16 11:03:09 +00:00
Nicholas Nethercote
fd5dafaac2 Make vg_regtest return 1 if any tests fail. Useful for scripts that call it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2283
2004-03-01 08:27:37 +00:00
Tom Hughes
e60cf234f7 Modified the basic standard error filter to strip out line info out of
order warnings which some systems seem to produce.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2278
2004-02-29 13:00:18 +00:00
Nicholas Nethercote
01e3fb111c Allow multiple .exp files, eg. foo.stderr.exp, foo.stderr.exp2; test will pass
as long as one matches.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2275
2004-02-29 01:31:09 +00:00
Nicholas Nethercote
39c1f4e7fc Update and add various .cvsignore files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2260
2004-02-22 19:34:55 +00:00
Nicholas Nethercote
4c8ecb23c3 Heroic patch from Tom Hughes:
This patch adds translation tests for most of the basic x86 instructions and
  fixes a few missing/broken instructions to work properly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2242
2004-02-11 23:33:29 +00:00
Nicholas Nethercote
c756c590cf Convert "skin" to "tool" in various places; almost entirely within comments,
nothing that will affect code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2217
2004-01-21 15:08:04 +00:00
Nicholas Nethercote
a49958845e Adding files from Tom Hughes' SSE-completion patch, which I forgot yesterday.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2209
2004-01-20 09:24:53 +00:00
Nicholas Nethercote
5630025b84 Patch from Tom Hughes, for bug 72643:
Patch to improve SSE/SS2 support

  This patch should implement most of the missing SSE/SSE2 opcodes. About
  the only ones it doesn't do are the MASKMOVxxx ones as they are quite
  horrible and involved an implicit reference to EDI so I need to think
  about them a bit more.

  The patch also includes a set of tests for the MMX/SSE/SSE2 opcodes to
  validate that they have the same effect under valgrind as they do when
  run normally. In one or two cases this wasn't actually the case even
  for some of the implemented opcodes, so I fixed those as well ;-)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2202
2004-01-19 19:14:18 +00:00
Jeremy Fitzhardinge
1c5b7f5311 Debork regtests
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2185
2004-01-05 01:02:10 +00:00
Dirk Mueller
6a73cf3d05 portability
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2171
2004-01-03 15:02:59 +00:00
Jeremy Fitzhardinge
918c3a7b7e This jumbo-checkin is the Full Virtualization checkin. This eliminates
Valgrind's dependency on the dynamic linker for getting started, and
instead takes things into its own hands.

This checkin doesn't add much in the way of new functionality, but it
is the basis for all future work on Valgrind.  It allows us much more
flexibility in implementation, and well as increasing the reliability
of Valgrind by protecting it more from its clients.

This patch requires some changes to tools to update them to the changes
in the tool API, but they are straightforward.  See the posting "Heads
up: Full Virtualization" on valgrind-developers for a more complete
description of this change and its effects on you.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2118
2003-12-16 02:05:15 +00:00
Nicholas Nethercote
1c69ebdcb4 Fix yet more "make dist" borkage
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2094
2003-12-04 16:15:25 +00:00
Dirk Mueller
2446c65296 only say something if there is something to say
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2037
2003-11-19 00:55:32 +00:00
Nicholas Nethercote
fb2d543ee8 Started to rescind the name "skin", replacing it with "tool". Did this in all
the places that normal users will see:

  - command line: --tool=foo (although --skin=foo still works)
  - docs: removed all traces (included renaming coregrind_skins.html to
    coregrind_tools.html)
  - in the usage messages
  - in error messages

Also did in in some places that I judged were unlikely to cause clashes with
existing workspaces:

  - in the header comments of many files (eg. "This file is part of Memcheck, a
    Valgrind tool for...")
  - in the regtests script
  - in the .supp files
  - in AUTHORS
  - in README_MISSING_SYSCALL_OR_IOCTL

Also update the AUTHORS file to mention Jeremy.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2027
2003-11-14 17:47:54 +00:00
Jeremy Fitzhardinge
d6fb2a6d85 Oops, add new files
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1976
2003-10-31 18:52:18 +00:00
Jeremy Fitzhardinge
65649c9d47 Patch from Robert Walsh <rjwalsh@durables.org>. Adds some new client
requests to allow client code to print messages through Valgrind's
logging mechanism.  The new requests are:
  VALGRIND_PRINTF - do a normal printf (prefixed with **PID**)
  VALGRIND_PRINTF_BACKTRACE - do a printf with stack trace
  VALGRIND_INTERNAL_PRINTF - printf, but for internal use (prefixed with ==PID==)
  VALGRIND_INTERNAL_PRINTF_BACKTRACE - as above, with backtrace


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1974
2003-10-31 07:12:21 +00:00
Nicholas Nethercote
f24e49d184 Change things so that helgrind regtests pass on my machine -- changed stderr
filters to strip out varying things, and changed outputs correspondingly.  Yell
if this breaks them for you.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1952
2003-10-18 14:16:01 +00:00
Jeremy Fitzhardinge
1e6361234c A complete reworking of Valgrind's handling of system calls and signals,
with the aim of making it more robust, more correct and perhaps faster.

This patch removes the need to poll blocking syscalls, by adding a proxy
LWP for each application thread.  This LWP is a kernel thread whose job
is to run all (potentially) blocking syscalls, and also to handle signals.

This allows the kernel to do more of the work of dealing with signals,
so on kernels which do this properly (2.6), Valgrind's behavious is a
lot more posix compliant.  On base 2.4 kernels, we emulate some of the
missing 2.6 functionality.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1918
2003-10-13 22:26:55 +00:00
Nicholas Nethercote
138ada5bc2 Fixed readv() and writev() so they won't fall over if they are given a negative
count.  Added a regression test for it.

Updated the basic test stderr filter to strip out line numbers from
vg_intercept.c

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1812
2003-09-04 21:57:45 +00:00
Nicholas Nethercote
9cad96992f Allow for 1 and 2 digit pids
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1741
2003-07-08 20:59:57 +00:00
Dirk Mueller
faf02201e5 spelling fixes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1715
2003-07-04 16:18:15 +00:00
Nicholas Nethercote
136c7fba2c Fixed cpuid regtest, which was broken by the switch to using the machine's real
CPUID.

Also added filters to Makefiles where missing;  "make regtest" was broken
within distributions created using "make dist", now fixed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1709
2003-06-29 10:12:58 +00:00
Nicholas Nethercote
83ef1ca2ed Some Makefile.am changes. Lots of them affected:
- changed deprecated INCLUDES variable to AM_CPPFLAGS

- moved the -DVG_LIBDIR definition from AM_CFLAGS into AM_CPPFLAGS

- generally neatened them up a bit -- removed old commented out stuff, fixed a
  couple of other minor things

Everything works for me, hopefully it won't break things for anyone else...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1680
2003-06-12 14:13:05 +00:00
Julian Seward
46aa527659 Fixed problems with reg tests for frames below main(), which were different
under some setups.

Also fixed problem with Cachegrind tests, by filtering out P4s'
warning message.

Also fixed 'mismatches'.

------------------------------------------------------------


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1616
2003-05-05 16:18:51 +00:00
Nicholas Nethercote
ba72812e02 This commit allows Valgrind to be run in-place from the source tree, without
requiring "make install".  This is good for two reasons:

1. shorter compile times ("make" instead of "make install")
2. don't need to install before running the regression tests

Changes:
 - root Makefile now builds a libpthread.so.0 symlink to libpthread.so, which
   was needed.

 - startup script accepts a --in-place=<dir> option for running a non-installed
   version, where <dir> is the root of the src tree

 - VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) had to be fiddled with a bit

 - tests/vg_regtest now uses the --in-place option to test the non-installed
   version


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1614
2003-05-05 12:47:25 +00:00
Nicholas Nethercote
9b3ef6f767 Improved filtering so that 'overlap' test less likely to fail.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1611
2003-05-05 09:09:08 +00:00
Dirk Mueller
04fe80c7e2 be a bit more libc tolerant
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1553
2003-04-24 01:01:01 +00:00
Nicholas Nethercote
dc0fe27537 Changed things so that the regression test script (vg_regtest) is no longer
installed, as it was silly since the reg tests themselves aren't installed.
Updated the "make regtest" target to use the uninstalled version in tests/.

Also, vg_regtest now no longer uses the installed version of Valgrind to do the
testing, but instead coregrind/valgrind.  This means that you don't have to do
make install with your buggy changes before running the regtests on them :)

I even updated the RPM package .spec file!

Thanks to Dirk M�ller for the suggestion.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1551
2003-04-23 21:48:20 +00:00
Nicholas Nethercote
dd6eacf7ff Now counting tests and stdout failures and stderr failures separately and
correctly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1547
2003-04-23 17:47:13 +00:00
Dirk Mueller
ba862b918e - fix regression tests counting
- unset $VALGRIND_OPTS (fixes 6 testsuite failures)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1545
2003-04-23 16:52:06 +00:00