2126 Commits

Author SHA1 Message Date
Nicholas Nethercote
e0c74bbbfa converted a few more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2987
2004-11-14 13:42:51 +00:00
Nicholas Nethercote
da82e7dd7a converted some more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2986
2004-11-13 13:57:12 +00:00
Tom Hughes
d3ecb6f1e8 Add the post handlers for the console ioctls that I managed to
forget to include yesterday.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2985
2004-11-13 10:38:04 +00:00
Tom Hughes
d249a6bd93 Remove a couple of commented out lines that were left in when committing
the previous stabs fix.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2984
2004-11-13 00:40:18 +00:00
Tom Hughes
bbc0767128 Fix compiler warning.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2983
2004-11-13 00:39:37 +00:00
Tom Hughes
8448d42efa Add support for most of the console driver ioctls. This fixes one of
the ioctls complained about in bug 93096 as well as one that came up
on the mailing list a few weeks ago.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2982
2004-11-13 00:36:15 +00:00
Tom Hughes
e35a3fb298 Try and improve the parsing of C++ stabs that contain :: sequences. This
patch attempts to follow the same rules that gdb uses and is based on the
fact that there appear to be three places where :: can appear:

  - In the name of a undefined struct/union/enum after an x type
    marker. In this case we follow a simplified version of the old
    rules and only allow :: inside <> characters.

  - In a method name. These are mangled so :: will never appear as
    part of the name but will always occurs as the terminator. We
    handle this by stopping at the first :: sequence.

  - In a symbol/type name. This can include :: but can only be ended
    by a single colon so we simply carry on until we see that.

I suspect this will resolve a number of bugs but I'm still waiting for
the submitters to confirm exactly which ones it resolves.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2981
2004-11-12 23:16:31 +00:00
Tom Hughes
3a70bde344 Change VG_(nuke_all_threads) to disassociate the the stacks of the threads
being killed from the threads rather than marking them as inaccessible.

This should fix the problem with the environment (and other data from the
stacks of other threads) causing warnings after a fork. I believe that
VG_(nuke_all_threads) is only called in places where this is the behaviour
that we want or where it doesn't matter because we're about to exit anyway.

I believe this fixes bug 85625 but I'm still waiting for confirmation.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2980
2004-11-12 23:11:21 +00:00
Nicholas Nethercote
e10f7ac465 convert some more, mash some more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2979
2004-11-12 21:21:07 +00:00
Nicholas Nethercote
17ce7e1ba9 Add commented-out templates so further additions are easier.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2978
2004-11-12 21:00:08 +00:00
Nicholas Nethercote
5bd31665ee mash things around to make further conversions quicker
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2977
2004-11-12 20:38:34 +00:00
Nicholas Nethercote
66213608e7 converted some more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2976
2004-11-12 19:55:08 +00:00
Nicholas Nethercote
a7d211f313 wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2975
2004-11-12 18:49:50 +00:00
Nicholas Nethercote
cdbb6cd2e1 and converted a few more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2974
2004-11-12 18:49:27 +00:00
Nicholas Nethercote
e3a2bb9405 renamed variables
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2973
2004-11-12 18:21:17 +00:00
Nicholas Nethercote
192c356143 converted some more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2972
2004-11-12 18:20:12 +00:00
Nicholas Nethercote
be04c2e5d9 Remove unnecessary comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2971
2004-11-12 17:13:17 +00:00
Nicholas Nethercote
c8d91069ed Use our own unistd.h, because the system one might be missing some of the
constants.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2970
2004-11-12 17:12:04 +00:00
Nicholas Nethercote
b54443644a Converted a whole bunch of syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2969
2004-11-12 17:07:26 +00:00
Nicholas Nethercote
0c0a684a6d Converted execve().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2968
2004-11-12 15:41:06 +00:00
Nicholas Nethercote
267ff3faac Converted vfork() and acct(). Properly annotated all the ones we don't handle,
plus a few we do.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2967
2004-11-12 14:57:34 +00:00
Nicholas Nethercote
691c66f51d Converted lookup_dcookie.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2966
2004-11-12 13:29:24 +00:00
Nicholas Nethercote
4a6c062608 CVS fixups: cvs add files I forgot to before; add .cvsignore entries.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2965
2004-11-12 11:25:39 +00:00
Nicholas Nethercote
ccdeacec51 Converted uname(); annotated some obsolete ones.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2964
2004-11-12 11:19:36 +00:00
Nicholas Nethercote
737cd1bece Added a syscall flag "NBRunInLWP" for non-blocking syscalls that must
nonetheless be run in LWP context.  Just makes things clearer.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2963
2004-11-12 11:02:00 +00:00
Nicholas Nethercote
c235901341 Now handling non-existent syscalls appropriately -- just returning ENOSYS
rather than giving the warning about the syscall being missing.  (Nb: this only
applies to syscall numbers for which the kernel has no corresponding syscall;
Valgrind will still give that warning if new syscalls are added to the kernel.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2962
2004-11-11 19:43:50 +00:00
Nicholas Nethercote
f49d300804 Converted fork(), and added a separate regtest for it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2961
2004-11-11 19:03:34 +00:00
Nicholas Nethercote
9f628720a2 Converted a bunch more syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2960
2004-11-11 18:00:47 +00:00
Nicholas Nethercote
4a31c80382 Converted a bunch of zero-arg syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2959
2004-11-11 16:38:21 +00:00
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