Commit Graph

1968 Commits

Author SHA1 Message Date
Nicholas Nethercote
eda1de342d Arch-abstraction:
- final fix for insn_* test moving;  they now work correctly


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2812
2004-10-19 19:39:39 +00:00
Nicholas Nethercote
cce964074d Arch-abstraction:
- Forgot to move the insn_*.def files when moving the insn_* tests.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2811
2004-10-19 19:12:21 +00:00
Nicholas Nethercote
78b8e2c67f Arch-abstraction:
- things I forgot to do when moving the insn_* tests...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2810
2004-10-19 19:07:32 +00:00
Nicholas Nethercote
66adb12133 Arch-abstraction:
- Moved all the insn_* tests into x86/ subdirectories.  What are the chances of
  me getting this right on the first attempt?


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2809
2004-10-19 18:54:11 +00:00
Nicholas Nethercote
e9bf009719 readability fiddle
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2808
2004-10-19 17:54:02 +00:00
Nicholas Nethercote
e2f30c46bc Forgot to cvs remove this when I moved it to x86/.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2807
2004-10-19 17:49:39 +00:00
Nicholas Nethercote
102a2ee374 Update
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2806
2004-10-19 17:30:47 +00:00
Nicholas Nethercote
eaa7a649e8 Whoops, forgot this file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2805
2004-10-19 17:30:25 +00:00
Nicholas Nethercote
03517b9c00 Arch-abstraction:
- Move x86-specific regtests for Cachegrind into an x86/ subdir.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2804
2004-10-19 17:00:59 +00:00
Nicholas Nethercote
f1f1e2ffe3 Arch-abstraction:
- Change regtest script to print a message if a test is skipped due to the cpu
  being of the wrong type.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2803
2004-10-19 16:56:41 +00:00
Nicholas Nethercote
f4d320e3c4 Arch-abstraction:
- Rewrote tests/cputest.c so that it can apply to different kinds of
  processors.  The idea being that any arch-specific tests have a cpu_test:
  label in their .vgtest file, so they'll only get executed if the right
  machine is being used.
- Rewrote a bunch of .vgtest files accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2802
2004-10-19 16:29:30 +00:00
Nicholas Nethercote
61efc22607 Use "ppc" rather than "powerpc" -- it's less typing.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2801
2004-10-19 14:24:42 +00:00
Nicholas Nethercote
3e21a5a1fd Whoops, syscall.S is platform-specific, and so must go in x86-linux/ rather
than x86/.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2800
2004-10-19 14:23:46 +00:00
Nicholas Nethercote
4b44d1df7d Arch-abstraction:
- Moved all assembly files in coregrind/ into coregrind/x86/.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2799
2004-10-19 13:48:06 +00:00
Nicholas Nethercote
266836ab69 Arch-abstraction:
- Factored out the remaining arch-specific code from vg_libpthread.c.
- Also fixed up the build process for x86/libpthread.c, which was done
  wrongly in the previous commit.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2798
2004-10-19 13:18:00 +00:00
Nicholas Nethercote
7ac2403543 Arch-abstraction:
- Started out x86-specific libpthread code; began with spinlocks.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2797
2004-10-19 11:38:48 +00:00
Tom Hughes
e581bc5f41 Really fix statically initialised read-write locks this time...
BUG: 91604


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2796
2004-10-18 23:03:24 +00:00
Tom Hughes
d7c9575904 Use tgkill instead of tkill if it is available. This is the newer and
safer kernel interface to signalling a particular thread and it ensures
you can only send a signal to one of your own threads.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2795
2004-10-18 18:56:25 +00:00
Nicholas Nethercote
bf0340373c Arch-abstraction: fix up valgrind.h for future inclusion of other
architectures.  Had to recast it as valgrind.h.in;  now at configure time the
appropriate #define is set so that the appropriate snippet of assembly code is
chosen.  It's done this way rather than with x86/ etc. directories like the
rest of Valgrind, because this header file must stand alone for inclusion by
other programs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2794
2004-10-18 18:07:49 +00:00
Nicholas Nethercote
f19fdbd136 Tweak type of VGA_(thread_syscall), and related variable name changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2793
2004-10-18 17:41:36 +00:00
Nicholas Nethercote
7d17111d99 Arch-abstraction:
- factor out the horrid thread_syscall() function, which is written in assembly
  code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2792
2004-10-18 17:36:40 +00:00
Tom Hughes
52eb188b93 Back-out accidental commit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2791
2004-10-18 17:35:35 +00:00
Tom Hughes
25725b8d8b Make statically initialised read-write locks work.
BUG: 91604


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2790
2004-10-18 17:34:43 +00:00
Nicholas Nethercote
296804a70e Arch-abstraction:
- factor out the setting of syscall results, which can be more complicated
  than just putting a value in the result register (eg. PPC has to fiddle with
  multiple registers).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2789
2004-10-18 17:00:30 +00:00
Nicholas Nethercote
e0e17fab32 Increase the size of M_VG_ERRTXT from 512B to 4KB, increasing the size of C++
names that can be demangled.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2787
2004-10-18 15:47:18 +00:00
Nicholas Nethercote
3cff5cf8d9 Arch-abstraction:
- factor out code for restarting syscalls


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2786
2004-10-18 15:34:14 +00:00
Nicholas Nethercote
f3ef39ea53 Arch-abstraction:
- account for x86's strange argument passing (via memory) for mmap()


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2785
2004-10-18 14:47:48 +00:00
Nicholas Nethercote
411cf69104 Arch-abstraction:
- just a couple more constants moved


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2784
2004-10-18 14:08:16 +00:00
Tom Hughes
f5216fc7c7 Add a couple of lines that were missed out in the long timeouts patch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2783
2004-10-18 12:11:23 +00:00
Nicholas Nethercote
493933b1c6 Arch-abstraction: a nice change that removes the need for ume_entry.S. Instead
of using an assembly hack to find the stack pointer at startup, we find it from
argv.  It's much simpler, avoids linking games, is platform independent, and
works on PPC.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2782
2004-10-18 11:52:17 +00:00
Tom Hughes
2d7c989f9a Fix problems with very long timeouts given when waiting on a mutex or
condition variable. The pthread routines now use a timeout of 0xfffffffe
if the user asks for something longer than that otherwise we will wrap
around and actually get a much shorter timeout.

The scheduler has also been changed so that it it now limits itself to
a timeout of 0x7fffffff when working how how long to poll for. This won't
affect how long a thread actually sleeps for as we'll just wind up waiting
a bit more on the next pass round the loop.

This fixes bug 76845.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2781
2004-10-17 15:18:22 +00:00
Tom Hughes
b7229cb4fc Implement pthread_mutex_timedlock. This resolves bug 78422.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2780
2004-10-17 15:00:20 +00:00
Tom Hughes
23cff452d7 When returning from handling a signal check whether any mutex that the
thread was waiting on has been unlocked while the signal handler was
running and resume the thread if it was.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2779
2004-10-16 16:50:14 +00:00
Tom Hughes
e531fcba56 If a thread is waiting on a mutex or condition variable when a signal is
delivered that the thread state is temporarily changed from WaitMX or WaitCV
to Running while the signal handler is running. The original state is then
restored when the handler returns.

This patch forces the associated_mx and associated_cv values to be cleared
at the same time and the original values restored afterwards. Without this
the scheduler state will not be considered sane while the handler is running.

This is based on a patch from Kenneth Schalk and fixes a problem he had
with posting to a semaphore in a signal handler. It also allows a couple
of assertions in the scheduler sanity check to be uncommented.

BUG: 72082


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2778
2004-10-16 16:17:06 +00:00
Nicholas Nethercote
7f7638248f Remove unnecessary glibc #includes; use VKI_O_RDONLY instead of O_RDONLY as
appropriate with VG_(open).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2777
2004-10-16 15:31:49 +00:00
Tom Hughes
e7e79a576f Remove the limit on the number of pthread read/write locks. This works
in a similar way to the previous patch that removed the limit on the
number of semaphores and fixes bug 86264.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2776
2004-10-16 14:49:53 +00:00
Tom Hughes
6204049d43 Add a dummy implementation of pthread_attr_getinheritsched.
BUG: 79495


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2775
2004-10-16 14:24:43 +00:00
Tom Hughes
58ae591be6 Suppress .stderr.diff2 files as well as .stderr.diff files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2774
2004-10-16 11:02:33 +00:00
Tom Hughes
76126d1e2b When signal routing is in use (because we are running on an older kernel
that doesn't route signals to the correct threads properly) the siginfo
data was not being propagated to any signal handlers installed by the
client program.

This is because the main thread routes the signal to the proxy LWP by
using the tkill system call but that then appears in the proxy as a user
initiated signal and the original siginfo data is lost.

This patch adds a small queue of siginfo data for pending sigals to
each thread's state so that when the proxy LWP passes the signal back
to the main thread the relevant siginfo data can be recovered and passed
on to any signal handlers. Thix fixes bug 91325.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2773
2004-10-16 10:59:49 +00:00
Tom Hughes
f2f2fe6cb7 Yet another attempt to quash the assertions in the pthread forwarding code.
It appears that the resolution of the address is to forward to is now
working properly but that on some systems the second part of the assertion
fails because the dynamic linker resolves the name of the function being
forwarded to the glibc version rather than the version in valgrind's pthread
library.

The solution is to use dlopen to explicitly obtain a handle to valgrind's
pthread library and then lookup the symbol with dlsym when doing the
comparison in the assertion.

BUG: 88614


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2772
2004-10-16 10:50:11 +00:00
Tom Hughes
38615b9b78 It seems there are some kernels around where the getpid system call has
been changed to return the ID of the thread group leader but which do not
have a gettid system call.

This breaks VG_(gettid) which assumes that the getpid system call will
give the thread ID if the gettid system call does not exist.

The (horrible) solution is to use readlink to see where /proc/self points
when the gettid system call fails.

BUG: 82114


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2771
2004-10-16 10:46:01 +00:00
Nicholas Nethercote
6059e23b99 Remove duplicate declaration.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2770
2004-10-14 14:24:55 +00:00
Nicholas Nethercote
cea83425b5 Remove unnecessary #includes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2769
2004-10-14 13:41:28 +00:00
Nicholas Nethercote
8a80e385e2 Replace glibc header with equivalent kernel header, which fixes a compile
problem seen by Sefer Tov.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2767
2004-10-14 11:18:26 +00:00
Nicholas Nethercote
6ca6b576e1 Since we use "-Wl,-e,_ume_entry" when linking stage2, there is no need to
rename "_start" as "_ume_entry" in stage2.lds.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2766
2004-10-14 10:58:28 +00:00
Nicholas Nethercote
62f87ac1f5 Change so that external tools can find the appropriate $ARCH and $PLATFORM
subdirs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2765
2004-10-14 10:22:19 +00:00
Nicholas Nethercote
aa5775f3a6 Avoid warning about not returning a value from main().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2764
2004-10-14 09:48:55 +00:00
Nicholas Nethercote
11c046a9b9 Arch-abstraction: replace direct mentions of x86/ directory with ${VG_ARCH}.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2763
2004-10-14 09:48:34 +00:00
Nicholas Nethercote
e7ca2d4602 Further strengthened the unit self-test, by also testing find_auxv(). Now all
functions exported by ume.c are tested.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2762
2004-10-14 09:28:11 +00:00
Nicholas Nethercote
9f0e6ed434 Strengthened the unit self-test, by also testing foreach_map(), the other
function exported by ume.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2761
2004-10-14 08:52:43 +00:00