Commit Graph

43 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Nicholas Nethercote
d1ad5601fb Arch-abstraction:
- factor out differences in ucontext types across different archs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2751
2004-10-13 14:42:57 +00:00
Nicholas Nethercote
fcae323a88 Arch-abstraction:
- move LDT stuff out of core, into x86-linux specific stuff.  Some of it
  (VG_(do_useseg)()?) may be really x86-specific, rather than
  x86/linux-specific, but that can be fixed later if it's really shared with
  another OS.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2748
2004-10-13 13:05:20 +00:00
Nicholas Nethercote
ce3c7200a7 Fix for bug 91162: cope with jumps to bogus addresses when there is a SEGV
signal handler present -- previously, Valgrind would abort unnecessarily on
this case.

Added a regression test for it.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2743
2004-10-13 09:47:24 +00:00
Tom Hughes
e340476ce0 When dieing because a fatal signal was received, print a stack trace for
the location where the signal was received rather then the signal handler.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2725
2004-09-26 18:44:06 +00:00
Nicholas Nethercote
d0d1c64875 Arch-abstraction:
- abstract out all the SET_THREAD_REG macros


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2716
2004-09-13 16:11:09 +00:00
Nicholas Nethercote
81803c220e Arch-abstraction:
- abstract out reg filling for core dumps


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2714
2004-09-13 15:19:34 +00:00
Nicholas Nethercote
d286eeff03 Arch-abstraction:
- abstract out signal frame pushing/popping


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2713
2004-09-13 14:15:36 +00:00
Nicholas Nethercote
fe64d52a7b Arch-abstraction:
- in vg_scheduler.c, abstract out some stack manipulations.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2711
2004-09-13 13:16:40 +00:00
Nicholas Nethercote
e0a284d9d7 Remove suppression files that have never been used, and don't get included in
"make dist".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2707
2004-09-13 11:05:11 +00:00
Nicholas Nethercote
9e21de1c3f wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2704
2004-09-11 23:51:50 +00:00
Nicholas Nethercote
68da16321d Arch-abstraction:
- in vg_symtab2.c, abstract out mentions of specific registers.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2703
2004-09-11 23:48:22 +00:00
Tom Hughes
2aad0526df Virtualise the stack rlimit for the main thread and make valgrind enforce
that limit when growing the stack. Also add a message when the stack in any
thread overflows.

CCMAIL: 73818-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2689
2004-09-11 14:16:57 +00:00
Nicholas Nethercote
db64449073 Arch-abstraction:
- added x86-linux/core_platform.h
- factored out getting/setting of system call arguments, put it in
  platform-specific part.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2685
2004-09-10 17:42:11 +00:00
Nicholas Nethercote
0792fdf54d Arch-abstraction:
- add a new file x86/x86_private.h, a header for the x86-specific stuff that is
  not seen by the core.
- move some LDT function decls into x86_private.h.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2683
2004-09-10 16:31:11 +00:00
Nicholas Nethercote
d544b7d93d Arch-abstraction:
- move some LDT constants into the x86-specific code.
- abstract out uses of LDT and TLS in vg_scheduler into the x86-specific code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2682
2004-09-10 15:33:32 +00:00
Nicholas Nethercote
a8d85f7180 Arch-abstraction:
- create coregrind/x86-linux/ directory.
- move vg_unistd.h into x86-linux/, because it's platform-dependent.  Also
  rename it as vki_unistd.h to make clear it's a kernel interface thing.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2681
2004-09-10 14:23:59 +00:00
Nicholas Nethercote
0a67ac22b4 Redo the regs setting for db-attach, in a way that works for PPC, which doesn't
support ptrace(SETREGS,...).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2678
2004-09-09 13:40:31 +00:00
Nicholas Nethercote
d897ba2bd1 To get 32-bit programs working on Opteron, VG_(valgrind_end) was recently
changed to name the last byte in Valgrind's section, rather than one past the
last byte.  This was because the last byte is 0xffffffff, and so one past gave
0x0, which screwed things up.

However, when this change was made, all the places where VG_(valgrind_end) is
used weren't adjusted appropriately.  So this commit makes those adjustments.
It also renames the variable as VG_(valgrind_last), which makes the difference
between it and the other VG_(*_end) variables much clearer.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2672
2004-09-07 23:04:49 +00:00
Nicholas Nethercote
0c56e65d07 Arch-abstraction:
- factored out pointercheck setup.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2671
2004-09-07 22:38:23 +00:00
Nicholas Nethercote
d5e1fb3c1d Arch-abstraction:
- factored out the setting of machine registers used when attaching the
  debugger.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2670
2004-09-07 22:22:39 +00:00
Nicholas Nethercote
4ecc334c35 Arch-abstraction:
- Moved VG_MAX_REALREGS into x86/ part.
- Tweaked basic types so they're suitable for both 32-bit and 64-bit platforms.
  Main change was to change 'Addr' to "unsigned long" which is the same size as
  a pointer.  Had to make a couple of minor changes to accommodate this.
  Also, introduced 'UWord' and 'Word' types which will be necessary for making
  code 64-bit clean.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2669
2004-09-07 10:17:02 +00:00
Nicholas Nethercote
28864b7564 Arch-abstraction:
- moved a lot of the baseBlock initialisation into x86/, including all the
  VGOFF variables, and all the x86 asm helper functions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2668
2004-09-06 16:43:37 +00:00
Nicholas Nethercote
f10521610a Arch-abstraction: minor name change of params.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2666
2004-09-06 15:14:46 +00:00
Nicholas Nethercote
cc5d7881d8 Arch-abstraction: made vg_execontext.c arch-independent, based on Paul
Mackerras's work.

- introduced arch-neutral macros for getting the instruction/frame/stack
  pointers.

- renamed ExeContext.eips as ExeContext.ips

- renamed esp/ebp/eip to sp/fp/ip in several related files and arch-neutralised
  various comments

- introduced arch-neutral macros for walking the stack


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2663
2004-09-05 21:32:37 +00:00
Nicholas Nethercote
04ae0fb5c2 Move env variables out of core_asm.h into core.h, where they should be.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2662
2004-09-05 20:39:51 +00:00
Nicholas Nethercote
18355ff96b Arch-abstraction:
- Added include/x86/:  contains tool_arch.h, Makefile.am, .cvsignore.

- Added coregrind/x86/state.c.  Contains some arch-specific code for dealing
  with x86 registers -- eg. setting up the baseBlock, loading/saving the whole
  register state.  It is compiled into coregrind/x86/libarch.a and linked via
  ${VG_ARCH} with the core.

  Relatedly, also added coregrind/x86/{core_arch.h,core_arch_asm.h}.

- Correspondingly abstracted the register state out of ThreadState.  This
  affected every place that touches registers, and there are a lot of them.
  (Eventually all the register touching should be abstracted out in an
  arch-neutral way, but not yet;  one step at a time.)

- Added some declarations about register loading/saving functions to core.h;
  all architectures will have to provide these functions.

- Rejigged the build system so that the arch-specific stuff is all done via
  ${VG_ARCH}, rather than naming e.g. x86/ directly.  Appropriate -I arguments
  are used so that all the headers are found, etc.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2656
2004-09-03 13:45:29 +00:00
Nicholas Nethercote
c8b2709153 Tweaked comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2655
2004-09-02 16:25:49 +00:00
Nicholas Nethercote
214cef4573 Arch-abstraction: add comment explaining header hierarchy.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2653
2004-09-02 16:02:58 +00:00
Nicholas Nethercote
3dc0e6069d Tweak some comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2651
2004-09-02 15:49:09 +00:00
Nicholas Nethercote
90369deb78 Arch-abstraction:
- renamed "vg_constants.h" as "core_asm.h".
- renamed "vg_constants_skin.h" as "tool_asm.h".
- renamed "mc_constants.h" as "mc_asm.h".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2650
2004-09-02 15:37:39 +00:00
Nicholas Nethercote
13a74aa53a Arch-abstraction: renamed "vg_skin.h" as "tool.h". Kept a residual vg_skin.h
(which just #includes tool.h) for backward-compatibility.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2647
2004-09-02 08:51:43 +00:00
Nicholas Nethercote
6a5de86389 Arch-abstraction: renamed "vg_include.h" as "core.h" (a few that I missed in
my previous commit).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2645
2004-09-02 08:10:13 +00:00
Robert Walsh
ef335b7ad1 Fix some vg_include.h references.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2644
2004-09-02 00:31:02 +00:00
Nicholas Nethercote
ba210a6364 Arch-abstraction step: renamed "vg_include.h" as "core.h".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2643
2004-09-01 23:58:16 +00:00