Commit Graph

2097 Commits

Author SHA1 Message Date
Nicholas Nethercote
becbfdddcb Arch-abstraction, syscall overhaul: rename functions appropriately
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2958
2004-11-10 19:08:31 +00:00
Nicholas Nethercote
22f3dd16c0 augmented scalar
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2957
2004-11-10 18:59:57 +00:00
Nicholas Nethercote
fc6b58b26c Arch-abstraction: syscall overhauling.
- Folded special_sys[] into sys_info[], which is cleaner and allows the one
  table to have the __NR_ constants in order.  An extra per-syscall flag
  (Special) was added to distinguish the special ones.

- Started moving the per-syscall flags attribute from being associated with the
  sys_info[] table, to being associated with the PRE/POST wrappers, since
  that's what the flags really apply to.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2956
2004-11-10 18:57:37 +00:00
Nicholas Nethercote
29fccd1d39 Arch-abstraction: syscall overhauling.
- Reordered the table according to the __NR_xxx numbering order, which is the
  order the final versions (there will be one per architecture) will be in.
  This shows clearly which syscalls we don't have wrappers for.

- Annotated each entry with its number and the sys_foo() function that it
  calls.  This will be useful as I convert them all to the new regime.
  For the same reason, I marked the ones that are generic across all Linux's
  architectures.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2955
2004-11-10 17:43:43 +00:00
Nicholas Nethercote
7c0a206e62 Converted __NR_{mount,getpid,getppid}.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2954
2004-11-09 16:45:33 +00:00
Nicholas Nethercote
fff1483600 - Convert open() to the new syscall regime.
- Improve scalar regtest;  I will add new syscalls to it as I convert them.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2953
2004-11-09 16:20:46 +00:00
Nicholas Nethercote
e367976dde Improve pth_cvsimple test in two ways:
1. Make the output deterministic;  different thread interleaving from expected
was causing failures for me.

2. Make it actually use the condition variable -- the condvar stupidly wasn't
actually being used in the expected case, because the other threads finished
all their work before pthread_cond_wait() even got called, and this prevented
the condition guarding pthread_cond_wait() from succeeding.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2952
2004-11-09 14:58:02 +00:00
Nicholas Nethercote
6e3638e2cf Disable --skin=, so you have to use --tool= now. No great loss.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2951
2004-11-09 14:35:43 +00:00
Nicholas Nethercote
a2954cd68b Improved memcheck/tests/scalar so that it shows an example whereby the syscall
number itself is undefined.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2950
2004-11-08 19:30:08 +00:00
Nicholas Nethercote
b55751404f Improved Memcheck's error checking messages in two significant ways:
- All memory-related errors are now clear whether they are caused by
  unaddressable or uninitialised memory.  (Previously, writes were
  clearly addressability errors, but reads could be either.)  Mostly
  done by replacing the 'isWrite' field in MAC_Error with 'isUnaddr'.
  Also, mc_check_readable() now indicates not just if an error occurred,
  but what kind of error (ie. addressability or definedness).

- Put machinery into place in the core to inform tools when registers
  are being read by the core -- ie. a 'pre_reg_read' event.  Most
  notably, this facilitates syscall scalar arg definedness checking for
  Memcheck.  Currently this is only working for read(), write(), exit()
  and exit_group(), but it will be extended as the syscalls are
  overhauled as part of the arch-abstraction work.

  A consequence of this is that the ParamErr messages have changed.  This:

    Syscall param write(buf) contains uninitialised byte(s)

  now means that the pointer 'buf' is partially undefined.  If the memory
  pointed to by 'buf' is partially undefined or unaddressable, it says one of:

    Syscall param write(buf) points to uninitialised byte(s)
    Syscall param write(buf) points to unaddressable byte(s)

  The docs have been updated accordingly.

  I also added a couple of regression tests.

These two change sare notable for being the first improvements to
Memcheck's checking/errors in a long time.

I also folded mc_clientreqs.c into mc_main.c, which saves exporting a
whole bunch of things that are not used anywhere else.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2949
2004-11-08 19:20:09 +00:00
Nicholas Nethercote
d67d99a446 Arch-abstraction:
- Started overhauling the syscalls to account for different architectures;
  in particular, accounts for the fact that the __NR_foo syscall number
  often doesn't directly match with the sys_foo() function that implements the
  function in the Linux kernel.  So started introducing this indirection as
  needed.  Currently, only read() and write() have been done;  the transition
  will be staged, since doing all syscalls in one hit is a total pain.

  This will also pave the way for scalar syscall arg checking with Memcheck,
  now that it is clear what the prototypes of the relevant syscalls are.

- Removed support for 2.2 kernels in the configure test, after discussion with
  Julian.  If it causes major problems, we can consider reverting.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2948
2004-11-08 17:51:39 +00:00
Nicholas Nethercote
6c2d25aae6 Don't silently ignore any suppression contexts beyond the 4th -- instead abort
with a warning.  Addresses part of bug #77922.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2946
2004-11-08 13:24:25 +00:00
Nicholas Nethercote
23a3dd3bb9 --trace-syscalls=yes wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2945
2004-11-08 13:02:53 +00:00
Nicholas Nethercote
e6b394151e Add very thorough string functions test from glibc.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2944
2004-11-07 10:58:19 +00:00
Nicholas Nethercote
746332ff63 Minor VKI_* fixups.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2943
2004-11-06 16:31:43 +00:00
Nicholas Nethercote
5856c549ed whitespace changes only
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2942
2004-11-06 16:17:52 +00:00
Nicholas Nethercote
7fbab350e1 Some syscall improvements:
- made pre_mem_read etc. calls more concise by improving the macros used
- made printing calls more concise by renaming the macro used
- updated README_MISSING_SYSCALL_OR_IOCTL
- improved --trace-syscalls=yes;  a bit neater, and now prints return values
  for all syscalls.
- introduced LOHI64 macro for 64-bit args that are created from 2 32-bit args
- 64-bit cleanness tweaks for *xattr* syscall printing


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2941
2004-11-06 15:38:43 +00:00
Nicholas Nethercote
05dfa7bb25 Fix incorrect cast that was causing wrong output with --trace-syscalls=yes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2940
2004-11-05 14:57:08 +00:00
Nicholas Nethercote
6030b047a8 Remove writev.stderr.exp3 -- not necessary if we pass -q to Valgrind.
Add writev.stderr.exp2 to the Makefile.am so it gets included in the distro.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2939
2004-11-05 13:45:53 +00:00
Nicholas Nethercote
df6d264d08 Make the checking of poll() more accurate.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2938
2004-11-05 12:02:27 +00:00
Nicholas Nethercote
3fb5db9b49 Order wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2937
2004-11-05 11:09:53 +00:00
Nicholas Nethercote
0b675e29c3 64-bit cleanness: some more.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2936
2004-11-04 20:00:44 +00:00
Nicholas Nethercote
22bd4534c8 64-bit cleanness: fix the memory arg of socketcall syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2935
2004-11-04 19:57:03 +00:00
Nicholas Nethercote
cdc43b9d17 whitespace wibbles
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2934
2004-11-04 19:43:22 +00:00
Nicholas Nethercote
bfcadc611a Make computations more understandable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2933
2004-11-04 19:40:59 +00:00
Nicholas Nethercote
64aaf7be92 comment wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2932
2004-11-04 19:39:14 +00:00
Nicholas Nethercote
7b5bf879ea More minor 64-bit cleanness tweaks.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2931
2004-11-04 19:38:14 +00:00
Nicholas Nethercote
7be3fc9c62 Comment/formatting wibbles.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2930
2004-11-04 19:33:51 +00:00
Nicholas Nethercote
c2faf8d5aa Make size calculation more robust.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2929
2004-11-04 19:32:10 +00:00
Nicholas Nethercote
6a5456bafb 64-bit cleanness tweak.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2928
2004-11-04 19:29:06 +00:00
Nicholas Nethercote
3a95fec6cc Formatting wibbles.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2927
2004-11-04 19:28:38 +00:00
Nicholas Nethercote
83d0f4f28f 64-bit cleanness: fix up types in libpthread.c.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2926
2004-11-04 19:11:19 +00:00
Nicholas Nethercote
1c674f8d7c Get rid of compile errors and warnings (ahem).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2925
2004-11-04 19:10:43 +00:00
Nicholas Nethercote
579966ed30 64-bit cleanness wibbles.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2924
2004-11-04 18:56:47 +00:00
Nicholas Nethercote
6d37450b6f Arch-abstraction: factor out a use of mmap() appropriately.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2923
2004-11-04 18:45:22 +00:00
Nicholas Nethercote
e59b9df749 64-bit cleanness: introduced OffT type for off_t, used it in a few important
places.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2922
2004-11-04 18:39:22 +00:00
Nicholas Nethercote
cc936a9c7c 64-bit cleanness: convert client requests to receive and return UWords.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2921
2004-11-04 18:22:28 +00:00
Nicholas Nethercote
6451cc22a2 64-bit cleanness: lots more replacing of UInt with UWord as necessary.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2920
2004-11-04 18:03:06 +00:00
Nicholas Nethercote
506ef239ea 64-bit cleanness: fix some more pointer casts to UInt.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2919
2004-11-04 17:24:57 +00:00
Nicholas Nethercote
3cd28a9282 Format wibbles.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2918
2004-11-04 17:10:24 +00:00
Nicholas Nethercote
7a32118f70 64-bit cleanness: convert some (UInt) casts of pointers to (UWord) casts.
Also, remove some unnecessary (UInt) casts of integers.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2917
2004-11-04 17:02:42 +00:00
Nicholas Nethercote
528046b537 64-bit cleanness: make the hash-table have UWord keys instead of UInt keys.
Allows addresses as keys.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2916
2004-11-04 16:39:43 +00:00
Benjamin Meyer
4582acb198 Changed to be consistant with the rest of the files
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2915
2004-11-04 16:16:59 +00:00
Nicholas Nethercote
65b45124ad 64-bit cleanness: replace hard-wired 0xffffffff literals with something less
32-bit-specific.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2914
2004-11-04 13:49:28 +00:00
Tom Hughes
1b3797c44e Add support for the settimeofday system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2911
2004-11-04 13:20:13 +00:00
Nicholas Nethercote
d8fc746ba4 64-bit cleanness: Yet more UInt-->SizeT changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2910
2004-11-03 18:10:37 +00:00
Nicholas Nethercote
3af1e3e24b 64-bit cleanness: More UInt-->SizeT changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2909
2004-11-03 17:07:46 +00:00
Nicholas Nethercote
c73601d666 64-bit cleanness:
- Use SizeT instead of UInt for new_mem_stack and all the related functions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2908
2004-11-02 13:29:50 +00:00
Nicholas Nethercote
d98a43bc4f 64-bit cleanness:
- Use SizeT instead of UInt for new_mem_stack and all the related functions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2907
2004-11-02 13:06:32 +00:00
Nicholas Nethercote
e245f2aeb0 64-bit cleanness: Converted malloc() et al to use SizeT rather than Int.
This required some tricks with casting to maintain Memcheck's silly (ie.
negative) arg checking.  The allocator was also changed accordingly. It
should now be able to allocate more than 4GB blocks on 64-bit platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2906
2004-11-02 12:36:02 +00:00