26 Commits

Author SHA1 Message Date
Tom Hughes
dd1b51f37c Add support for the fadvise system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3571
2005-04-26 08:13:24 +00:00
Julian Seward
3f12fcbba8 Create a new module: ASpaceMgr, the address space manager. This
contains what was previously vg_memory.c and also vg_procselfmaps.c,
which is really just a helper for the address space manager.

This just moves code around and modularises it a bit.  It doesn't yet
resolve the circular dependencies between ASpaceMgr and various other
chunks of functionality (vg_malloc2, vg_symtab2).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3564
2005-04-25 11:11:44 +00:00
Nicholas Nethercote
fe21329e16 Renamed and retyped the fields relating to valgrind's stack in os_state_t to
make their role clearer and their behaviour more consistent with the fields
describing the client's stack.  Also made the code in x86-linux/syscalls.c
and amd64-linux/syscalls.c more word-size-independent, which is not strictly
necessary but makes the code similarities between the two files more
obvious.

One consequence of this is that Valgrind's stack on AMD64 is now 16384 * 8
bytes, rather than 16384 * 4 bytes.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3520
2005-04-05 02:49:09 +00:00
Tom Hughes
61ca56765a Move the gettid system call to the linux specific section.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3493
2005-03-31 16:02:07 +00:00
Tom Hughes
ba4f330105 Build the arch, os and platform libraries as PIE code if PIE is
enabled as they get linked into stage2 which is the PIE part.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3472
2005-03-29 08:09:31 +00:00
Nicholas Nethercote
d5717b3e8c The two patches attached resolve the exit-hang (of OOo) bug for me. The first
fixes getppid(), and the second fixes the next bug which is revealed
once getppid() does what LinuxThreads wants;  LinuxThreads uses SIGKILL
to kill off stray threads, but if we send naked SIGKILLs to Valgrind
threads, they'll die without cleaning up or informing anyone of their
death, which means that they're waited on forever. 

ADAPTED FROM CVS HEAD



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3449
2005-03-26 20:08:06 +00:00
Nicholas Nethercote
f385afbb5c sys_futex's FUTEX_(CMP_)REQUEUE requests use the futex2 pointer (not
timeout); FUTEX_CMP_REQUEUE also uses the timespec pointer as an integer.       
                                                                                
Also, more clearly document the argument usages, and make the per-operation     
special cases clearer.             

MERGED FROM CVS HEAD


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3447
2005-03-26 16:44:19 +00:00
Nicholas Nethercote
b08a041b56 Use "VGO_" prefix for various OS-specific exports.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3437
2005-03-26 02:57:36 +00:00
Julian Seward
28650c3aa0 jmp_with_stack is a hack which makes no sense on archs which pass args
in registers.  Replace it (for amd64) with something more disciplined:
call_on_new_stack_0_0 and call_on_new_stack_0_1.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3401
2005-03-22 00:19:55 +00:00
Julian Seward
8a5c020b4f Fix VG_({un}pad_address_space) so as to make sys_io_setup work again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3383
2005-03-17 02:14:44 +00:00
Julian Seward
0fb874a32d A gcc-2.96 build fix.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3358
2005-03-14 19:52:16 +00:00
Julian Seward
d2bc233d5e Add support for sys_tgkill (syscall 270), needed by tls gunk on
x86-linux.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3341
2005-03-13 18:02:51 +00:00
Nicholas Nethercote
05fe123a9e Update copyright notice for 2005 on all relevant files. Don't bother trying
to be selective about it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3303
2005-03-12 16:22:54 +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
61fcb2828d Gave VG_(do_syscall)() a more specific prototype:
Int VG_(do_syscall) ( UInt, UWord, UWord, UWord, UWord, UWord, UWord );

to replace the previous:
  
  Int VG_(do_syscall) ( UInt, ... )

Reason being that sometimes you could get incorrect args passed, when
passing 32-bit ints on 64-bit platforms.  I also added macros
VG_(do_syscall[123456]) to make life easier, and converted all the
relevant calls.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3143
2004-11-29 16:49:18 +00:00
Nicholas Nethercote
8a1cef27ad Minor 64-bit cleanups, mostly comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3140
2004-11-29 15:45:31 +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
4e12afbac2 Moved some duplicated macros out of arch/OS/platform-specific parts,
into the core.  Renamed them with capital letters at the same time (eg.
arg1-->ARG1, res-->RES) to reduce likelihood of name conflicts, and also
it doesn't hurt to make it clearer that they're macros.  The result is a
very big diff, but conceptually it's very simple.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3126
2004-11-27 16:10:23 +00:00
Nicholas Nethercote
f23dea17b2 Factored out some stuff duplicated across all archs, to do with syscall
wrappers.  The management apologises for the excessive use of macros, but it's
hard to avoid and really does make the repetitive parts of the code (ie. the
parts that are repeated for each arch) much more concise.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3124
2004-11-27 15:22:24 +00:00
Nicholas Nethercote
feb4fbaef5 Removed all uses of register numbers (eg. arch-specific ones like R_EAX, and
arch-neutral ones like R_STACK_PTR).  Where they were used, we now always talk
about an offset into the Vex guest state, and an offset.  As a result,
the shadow register get/set functions had to change.  They now also use
an offset and size, and in an arch-neutral way.

Also, I combined the five the post_reg_write* functions into a single one that
takes a 'CorePart' parameter (plus also a ThreadId).  Also, I added more
arguments (the CorePart, and the ThreadId) to the post_mem_write event, for
consistency with the pre_mem_* events.

Also, I reduced the number of register names that must be specified by each
arch, by factoring out duplication; and shortened their names for the core (eg.
ARCH_STACK_PTR is now STACK_PTR).

Plus some related minor cleanups in syscall wrappers.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3094
2004-11-24 16:30:22 +00:00
Nicholas Nethercote
6b0114e409 Added missing .cvsignore file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3044
2004-11-18 13:34:00 +00:00
Nicholas Nethercote
6918dc8dc3 Convert a whole bunch of "(UWord)NULL" occurrences to 0, which is easier to
read and understand.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3038
2004-11-17 18:42:20 +00:00
Nicholas Nethercote
2f787498e8 Arch-abstraction:
- Moved some more syscall wrappers into linux/syscalls.c and
  x86-linux/syscalls.c.  There are still heaps of wrappers that probably aren't
  generic, but I'm not sure, so they're staying in vg_syscalls.c for now.
  Let's worry about that when we do an OS port.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3036
2004-11-17 18:22:38 +00:00
Nicholas Nethercote
05522127c4 Add coregrind/linux/ and coregrind/linux/* that was supposed to go in the last
commit.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3035
2004-11-17 17:21:12 +00:00