87 Commits

Author SHA1 Message Date
Nicholas Nethercote
3bfae3eec1 Merged r9185 (fix up getsockopt mess) from the DARWIN branch, minus the
Darwin-specific parts.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9186
2009-02-17 00:23:30 +00:00
Tom Hughes
f1ac1fd992 Add signalfd4 support.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8930
2009-01-09 16:42:51 +00:00
Tom Hughes
2ebda825b1 Add support ioprio_get and wire up ioprio_set on all platforms.
Fixes bug #177819.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8826
2008-12-15 08:58:29 +00:00
Tom Hughes
4d4d4c10fe Add support for eventfd2 (and wire up pipe2 on PPC platforms).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8815
2008-12-10 09:28:56 +00:00
Julian Seward
2ebd38040f Handle sys_lookup_dcookie on amd64-linux (Andrew Haley). Also take
the opportunity to move the handlers from syswrap-generic.c (which
they certainly aren't) to syswrap-linux.c.  Fixes #175044.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8769
2008-11-16 21:40:54 +00:00
Julian Seward
2a5db7f788 Support sys_stime on x86-linux. Fixes #159285.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8736
2008-11-06 23:11:42 +00:00
Julian Seward
f4bffe6909 Support sys_pipe2 on {amd64,x86}-linux. Also, update syscall numbers
for all supported Linuxes to those in linux-2.6.28-rc3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8730
2008-11-05 11:20:59 +00:00
Julian Seward
335992d8fc Merge all remaining changes from branches/PTRCHECK. These are some
relatively minor extensions to m_debuginfo, a major overhaul of
m_debuginfo/readdwarf3.c to get its space usage under control, and
changes throughout the system to enable heap-use profiling.

The majority of the merged changes were committed into
branches/PTRCHECK as the following revs: 8591 8595 8598 8599 8601 and
8161.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8621
2008-09-18 18:12:50 +00:00
Julian Seward
832a3d400b Tidy up the wrappers for pread64 and pwrite64, and make these two
syscalls available on ppc64-linux.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8519
2008-08-07 20:29:55 +00:00
Bart Van Assche
8e96150945 Merged FORMATCHECK branch (r8368) to trunk.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8369
2008-07-07 06:49:24 +00:00
Bart Van Assche
bd28f145d5 Moved support for Linux-specific system call sys_init_module from generic to Linux wrappers. Added wrapper for sys_delete_module system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8266
2008-06-21 16:28:24 +00:00
Bart Van Assche
df3037fdc9 Removed superfluous #include directive.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8124
2008-05-25 16:01:03 +00:00
Julian Seward
4cae5c3ed5 Merge branches/OTRACK_BY_INSTRUMENTATION into the trunk. This adds
support to Memcheck for tracking the origin of uninitialised values,
if you use the --track-origins=yes flag.

This currently causes some Memcheck regression tests to fail, because
they now print an extra line of advisory text in their output.  This
will be fixed.

The core-tool interface is slightly changed.  The version number for
the interface needs to be incremented.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7982
2008-05-01 20:24:26 +00:00
Bart Van Assche
c6d4c09e7c Added support for timerfd_create(), timerfd_gettime() and timerfd_settime() system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7942
2008-04-27 12:56:06 +00:00
Bart Van Assche
e31611fb5c Added support for epoll_pwait(), utimensat(), eventfd(), timerfd() and signalfd(). Fixes bug 160907.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7917
2008-04-26 07:45:10 +00:00
Tom Hughes
34d1e3b268 Always call ML_(generic_POST_sys_shmat) when a shmat call succeeds, even
if the memory was attached at address zero. Fixes bug #157665.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7399
2008-02-11 14:47:05 +00:00
Julian Seward
5679a22410 Update copyright dates ("200X-2007" --> "200X-2008").
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7398
2008-02-11 11:34:59 +00:00
Julian Seward
7cebb7d626 Include headers for VG_(register_stack) calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7396
2008-02-11 11:23:12 +00:00
Tom Hughes
2e55cfac69 Make the clone system call wrappers call VG_(register_stack) to record
the new thread's stack, then make the stack unwinder use that information
to make a better guess at the stack bounds.

This helps avoid crashes trying to unwind the stack under wine when
the starting point is a routine without a proper stack frame.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7383
2008-02-08 15:17:07 +00:00
Tom Hughes
cbb3cb05a5 Add support for the sync_file_range system call.
Based on patch from Russell Sears <sears@cs.berkeley.edu>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7324
2008-01-08 16:31:25 +00:00
Julian Seward
4d601bfed7 Support sys_utimensat on x86-linux. (Dan McGee)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7195
2007-11-20 23:41:23 +00:00
Julian Seward
06666933d9 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7123
2007-11-09 23:21:44 +00:00
Julian Seward
1d31d0b60c Followup to r6650: tidy up sys_sigreturn/sys_rt_sigreturn on ppc32/64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6651
2007-03-19 14:34:08 +00:00
Julian Seward
664364751b Document and tidy up one of the more arcane corners of signal
handling: why PRE(sys_sigreturn) has to construct a fake syscall
return value which, when written back to the guest state, leaves it
unchanged.  It's only taken me about 3 years to realise why :-)
Fixes to ppc platforms to follow.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6650
2007-03-19 13:38:11 +00:00
Tom Hughes
0075b20e84 Add support for linux key management system calls.
Based on patch from Ezra Peisach <epeisach@bu.edu>.
Fixes bug #139300.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6632
2007-03-07 11:12:13 +00:00
Tom Hughes
cbb98bc70d Handle some additional ptrace reason codes. Based on a patch
from Magnus Vesterlund <magnus_vesterlund@hotmail.com>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6630
2007-03-07 09:48:32 +00:00
Julian Seward
172505c978 Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488
2007-01-08 06:01:59 +00:00
Julian Seward
37c3d2ead6 Merge (from 3_2_BRANCH) r6457/8 (Support 64k pages on ppc32/64-linux
(Jakub Jelink, Dave Nomura) )



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6459
2006-12-30 17:45:08 +00:00
Tom Hughes
69c8af5179 Improve prctl support - based on patch from Eric Pouech in bug #138627.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6410
2006-12-18 15:22:46 +00:00
Julian Seward
bbe7f55813 Merge r6140 (some of):
- track SysRes changes

- track VG_(am_find_nsegment) const-ness change

- increase number of client syscall args supported from 6 to 8

- simplify type SyscallStatus.  Simply hold a copy of the SysRes
  for the syscall rather than have this be a data structure
  incorporating something very similar to the fields of a SysRes,
  and more besides.  Change various macros in priv_types_n_macros.h
  to match.

- syswrap-main.c: instantiate the various impedance-matching
  functions for AIX.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6276
2006-10-17 01:47:30 +00:00
Julian Seward
ae8215b3ac Create a new module, m_vki, and move all knowledge about the kernel
interface, except for the syscall numbers, into that.  Mostly this
means moving include/vki-*.h to include/vki/vki-*.h.

include/pub_tool_basics.h previously dragged in the entire kernel
interface.  I've done away with that, so that modules which need to
see the kernel interface now have to include pub_{core,tool}_vki.h
explicitly.  This is why there are many modified .c files -- they have
all acquired an extra #include line.

This certainly breaks all platforms except x86.  Will fix shortly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6225
2006-10-14 19:26:10 +00:00
Julian Seward
4b572a567e Create a new module, m_vkiscnums, and move all the system call numbers
into that.  Mostly this means moving vki_unistd-<plat>.h to
include/vki/vki-scnums-<plat>.h.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6224
2006-10-14 15:51:32 +00:00
Julian Seward
ad67fd79fe Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954
2006-06-05 23:21:15 +00:00
Tom Hughes
297aa09b43 Implement the set_robust_list and get_robust_list system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5905
2006-05-17 14:24:12 +00:00
Julian Seward
6fc030b2be Fix printing bug in PRE(sys_stat64).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5881
2006-05-04 16:43:34 +00:00
Tom Hughes
2b63758b93 Enable sigsuspend on x86-linux and ppc32-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5819
2006-04-03 16:38:33 +00:00
Tom Hughes
4eb782b553 Add wrappers for a load of new 2.6.16 system calls. Fixes bug #123248.
Also expands pathname arguments as strings in a lot more system call
trace messages and fixed the poll wrapper to not be x86 specific.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5785
2006-03-21 10:58:35 +00:00
Tom Hughes
391d10fdeb Fix the tkill system call wrapper and enable it on x86 and amd64.
Fixes bug #121901.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5651
2006-02-15 10:34:50 +00:00
Tom Hughes
3c2633355f Implement the vm86 and vm86old system calls based on a patch
from Alper Akcan. Fixes bug #118939.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5635
2006-02-11 16:26:46 +00:00
Julian Seward
19e8e951e5 Counterpart to r5202: restore previous assembler state with .previous
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5204
2005-11-19 02:02:57 +00:00
Julian Seward
418aae5c97 Hmm. Perhaps all those top-level pieces of assembly weren't such a
clever idea.  There's no reason to assume the assembler is in
.text-mode when it encounters them, and as gcc 2.96 rudely
demonstrates, sometimes it isn't.  So put .text in front of all of
them.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5202
2005-11-18 23:50:43 +00:00
Nicholas Nethercote
057061d2ae Try to avoid compiler warnings on AMD64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5065
2005-11-10 04:02:19 +00:00
Nicholas Nethercote
8a58b97fbb Factor out some common code in m_syswrap.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5062
2005-11-10 02:48:04 +00:00
Nicholas Nethercote
bf21ecfdb0 Factor out some common code in m_syswrap.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5049
2005-11-09 04:49:28 +00:00
Julian Seward
6510569558 Liberalise x86 clone flag handling, so it's as per amd64/ppc32.
However, leave the old code in place, disabled, for documentary
reasons.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5023
2005-11-05 15:13:23 +00:00
Tom Hughes
2b553e2835 Add support for the mbind system call on x86 and amd64. Fixes bug #114756.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4958
2005-10-20 17:00:23 +00:00
Tom Hughes
fa32067e45 Fix x86 specific declaration-before-statement warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4907
2005-10-12 10:50:56 +00:00
Julian Seward
287d92271f The m_syswrap subsystem is Valgrind's model of how the kernel behaves
with respect to syscalls.  It is detailed and comprehensive but does
not offer a way to deal with minor deviations in behaviour from the
vanilla kernel sources, either due to running a hacked kernel or
running a vanilla kernel with a custom kernel module loaded.

This commit adds a flexible way to handle such cases without polluting
the vanilla handler syswrap-*.c files or their supporting vki_*.h
header files.  For each OS, a syswrap-OS-variants.c file is added,
containing wrappers for variants of OS.  A new command line flag
--kernel-variants= carries a comma separated list of variant names
that apply to the current run.  There are no other changes.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4873
2005-10-06 03:19:49 +00:00
Julian Seward
b7cd9cb3de Plumb 64-bit file offsets throughout the address space manager.
Untested.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4844
2005-10-02 17:01:41 +00:00
Tom Hughes
6c610b89c7 Rationalise the mmap system call handling - after examining the kernel
source it turns out that there are five different versions of mmap for
the three platforms we currently support:

  - On x86-linux there is mmap (aka old_mmap) which takes the
    arguments in a memory block and the offset in bytes; and
    mmap2 (aka sys_mmap2) which takes the arguments in the normal
    way and the offset in pages.

  - On ppc32-linux there is mmap (aka sys_mmap) which takes the
    arguments in the normal way and the offset in bytes; and
    mmap2 (aka sys_mmap2) which takes the arguments in the normal
    way and the offset in pages.

  - On amd64-linux everything is simple and there is just the one
    call, mmap (aka sys_mmap)  which takes the arguments in the normal
    way and the offset in bytes.

To reconcile all this I have created a generic handler and then
written five platform specific wrappers which normalise all the
arguments and then call the generic handler.

I have also modified the address space manager to use mmap2 rather
than mmap on x86 and ppc32 so that large offsets can be correctly
handled.

There is still an issue of OffT truncating offsets as we go through
the address space manager that will need to be addressed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4834
2005-09-30 08:07:53 +00:00