Commit Graph

224 Commits

Author SHA1 Message Date
Nicholas Nethercote
1826c24b7f Bah, get the compiler-warning avoidance right this time.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3422
2005-03-24 04:41:16 +00:00
Nicholas Nethercote
3f724359ac Avoid compile warning.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3420
2005-03-24 04:39:33 +00:00
Julian Seward
2e5e444f34 amd64-linux build fix
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3412
2005-03-23 13:09:55 +00:00
Julian Seward
cdb6df5b59 Track recent jmp_with_stack hackery.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3405
2005-03-22 02:43:14 +00:00
Julian Seward
2eb10d8e1c Add another possible .stderr output for memcheck/tests/writev.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3379
2005-03-16 13:10:44 +00:00
Julian Seward
bdca1d1f3d Remove pth_once from memcheck/tests. It already exists in
corecheck/tests and there is no point in duplicating it.  Given that
it was intended to check the behaviour of our now-defunct pthread
implementation there's not much point in keeping it at all.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3378
2005-03-16 12:37:30 +00:00
Julian Seward
d56fb1f475 Update expected outputs to include missing stack frames that old UCode
machinery caused to be missed due to not keeping %EBP up to date.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3375
2005-03-16 11:55:34 +00:00
Nicholas Nethercote
3b6dc1d548 Make scalar.c slightly more robust against certain kinds of failures.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3372
2005-03-16 03:29:08 +00:00
Nicholas Nethercote
05cbc6b2e1 Tweak manuel2 so that the Memcheck-detected error is more reliable, and that
we never accidentally also get an undefined-condition-error.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3371
2005-03-16 03:07:33 +00:00
Nicholas Nethercote
3c1778a582 Don't let GCC4.0 inline memcpy() and memcmp(), else the tests fail.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3370
2005-03-16 02:49:11 +00:00
Julian Seward
4f5ccbe0c2 gcc-2.96 build fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3362
2005-03-15 01:41:08 +00:00
Nicholas Nethercote
1b3b96a692 Fix false assertion in pattern matching.
MERGED FROM CVS HEAD


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3279
2005-03-11 05:05:50 +00:00
Nicholas Nethercote
38c5424bc9 Remove messages about not being able to clean up non-existent core files.
MERGED FROM CVS HEAD


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3277
2005-03-11 04:48:18 +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
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
f00e834c58 Use better syscall argument names for two wrappers, now that "res" and
"arg[2345]" don't clash with macros.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3128
2004-11-27 16:57:18 +00:00
Nicholas Nethercote
7a04aed730 Introduced build variables VG_ARCH_ALL, VG_OS_ALL, and VG_PLATFORM_ALL,
which list all the arches/OSes/platforms supported.  These are used by
several newly added DIST_SUBDIRS automake commands, which specify that
although when you are building you only want to build for the current
arch/OS/platform, when you do 'make dist' you want every
arch/OS/platform to get included.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3127
2004-11-27 16:47:42 +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
ead76e69ac Removing the insn_* tests from helgrind, memcheck, addrcheck and
cachegrind, because having them there doesn't add anything beyond that
tested in 'none'.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3101
2004-11-25 17:47:43 +00:00
Nicholas Nethercote
9f2118c217 Fix this regression test to account for the fact that FP regs are now
checked for definedness errors lazily, just like integer regs.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3084
2004-11-23 17:19:53 +00:00
Nicholas Nethercote
f7d26d172b Make these work again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3083
2004-11-23 17:13:58 +00:00
Nicholas Nethercote
6cc0d4c473 Add a mandatory --with-vex option to configure script.
Also, fix a Makefile so that Memcheck's regtests all build again.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3081
2004-11-23 16:31:56 +00:00
Nicholas Nethercote
7f0984ea02 The syscall wrappers for sys_fcntl{,64} were too simplistic -- the 3rd
arg is only used if the 2nd arg has particular values, so we were
getting false positives.  This commit makes the wrappers smarter to
account for this.  I updated the reg test too.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3080
2004-11-23 14:57:49 +00:00
Nicholas Nethercote
eb802373ac No longer producing this file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3051
2004-11-19 16:10:23 +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
26361b37e9 account for restart_syscall
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3028
2004-11-16 18:20:35 +00:00
Nicholas Nethercote
583e072e7f fix incorrect counts
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3027
2004-11-16 18:13:11 +00:00
Nicholas Nethercote
6b8d578f39 Add some missing test cases.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3026
2004-11-16 17:59:04 +00:00
Nicholas Nethercote
1524d5ac06 Converted the last syscalls. Phew. Still some cleaning up to do, esp. with
socketcall() and ipc() which are done too simplistically.

Also, VG_([gs]et_thread_area)() both now return -VKI_EFAULT if they are given a
NULL pointer.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3024
2004-11-16 17:13:24 +00:00
Nicholas Nethercote
126c196c21 Converted the timer_* and clock_* syscalls.
Also now checking the return value of every syscall in scalar, to make sure
that they (mostly) fail as expected.  Because occasionally one would succeed
unexpectedly and unaddressable memory would be marked as addressable, and
things would go haywire.  (The fact that the wrapper sets the memory as
addressable in these cases is a bug with the relevant wrappers;  I'll fix them
later.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3023
2004-11-16 16:15:41 +00:00
Nicholas Nethercote
c026b31697 Converted the io_* and mq_* syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3022
2004-11-16 12:58:04 +00:00
Tom Hughes
a8d21d440f Use sigprocmask(SIG_SETMASK) to make sure the signal mask is in a
known state before performing the test. This is done because perl on
some systems leaves some signals blocked when starting child
processes which can cause this test to fail.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3021
2004-11-16 12:09:43 +00:00
Tom Hughes
e07366ea5e Add arguments to the prctl call in the scalar test.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3019
2004-11-16 08:27:21 +00:00
Nicholas Nethercote
d3cb945e9b add a bunch of tests
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3018
2004-11-15 20:42:06 +00:00
Nicholas Nethercote
28395a2a4a Forgot to add the expected stderr output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3015
2004-11-15 19:09:03 +00:00
Nicholas Nethercote
39914e513d Converted sigprocmask and rt_sigprocmask.
While doing so, fixed bug #93328, by using the right sized types in
sigprocmask(), and converting them as necessary.  Added a regression test for
it too.

(partly) MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3013
2004-11-15 19:03:27 +00:00
Nicholas Nethercote
0ec929266e convert a couple more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3012
2004-11-15 17:19:22 +00:00
Nicholas Nethercote
2c423e4567 Convert more syscalls. Avoid obvious seg faults due to NULL vectors in readv()
and writev().


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3011
2004-11-15 17:04:14 +00:00
Tom Hughes
825ce5be82 Pass an argument to exit_group in the scalar_exit_group test.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3010
2004-11-15 16:59:18 +00:00
Nicholas Nethercote
ba41261f08 Converted modify_ldt() and init_module(); the old code for init_module() was
seemingly totally wrong, as the man page doesn't reflect the real kernel code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3009
2004-11-15 16:40:40 +00:00
Nicholas Nethercote
98da137d80 Add scalar_exit_group to reg tests. Tweak scalar.c again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3008
2004-11-15 16:11:20 +00:00
Tom Hughes
de135bbb7f After a clone system call there are two threads of control running so we
need to make sure the child exits or we will get two copies of the output
from each test which follows. Also some older systems do not define the
CLONE_PARENT_SETTID flag.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3007
2004-11-15 15:35:49 +00:00
Nicholas Nethercote
a01f2960be Fill in missing cases in scalar.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3006
2004-11-15 15:31:17 +00:00
Nicholas Nethercote
aa4b01411e converted more syscalls
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3005
2004-11-15 14:50:02 +00:00
Nicholas Nethercote
a0ce711edb Converted more syscalls
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3004
2004-11-15 14:32:12 +00:00
Nicholas Nethercote
df2c9db230 converted mmap and mmap2
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3003
2004-11-15 12:57:39 +00:00
Nicholas Nethercote
ad980e636a Converted a few more, including clone() which I'm not at all sure about, and
ipc() which is done too simplistically.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3002
2004-11-15 12:28:58 +00:00