Commit Graph

1181 Commits

Author SHA1 Message Date
Nicholas Nethercote
49eea042c1 Arch-abstraction: introduce constants for min and max instruction sizes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2660
2004-09-04 15:28:37 +00:00
Nicholas Nethercote
b392873e38 Removed x86/ume_archdefs.h; moved CLIENT_BASE into x86/core_arch.h.
(CLIENT_BASE wasn't really part of UME.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2659
2004-09-03 23:25:33 +00:00
Nicholas Nethercote
e8b7f64002 Removed x86/ume_arch_defs.c, which just defined the never-used variable
CLIENT_START.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2658
2004-09-03 14:24:22 +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
397446e355 Arch-abstraction:
- removing the directories arch/x86-linux and arch/x86-freebsd, the contents of
  which were never actually used.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2654
2004-09-02 16:05:20 +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
fef3e74483 Remove unnecessary #include statement.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2646
2004-09-02 08:18:07 +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
Nicholas Nethercote
acd57ac595 Use Makefile.am includes. This gets rid of 110 lines of repetitive Makefile.am
cruft, yay!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2641
2004-09-01 23:20:49 +00:00
Nicholas Nethercote
a03b974a90 'valgrind' (ie. stage1) does not need to be installed in $PREFIX/lib/valgrind/;
$PREFIX/bin/ is enough.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2640
2004-09-01 11:33:35 +00:00
Tom Hughes
19bd50ea16 Move the include of linux/fs.h before the include of sys/un.h as the
latter includes string.h on some older systems which then causes
problems when linux/fs.h includes linux/string.h due to it turning
various string functions into pre-processor macros.

This was the problem behind bug #87820 which actually had nothing to
do with gcc 2.95 and everything to do with the glibc and kernel
headers that the system had installed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2639
2004-09-01 07:31:12 +00:00
Tom Hughes
9a416ac766 Make some of the parallel port ioctls conditional as older systems
don't have them defined.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2638
2004-09-01 07:29:08 +00:00
Julian Seward
d4262b160d Add comments about limitations wrt self-modifying code.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2632
2004-08-31 00:13:10 +00:00
Tom Hughes
0cd1d01031 Add support for POSIIX clocks and timers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2630
2004-08-30 19:50:02 +00:00
Nicholas Nethercote
78cb64cc71 Print a message if shadow memory cannot be allocated, rather than just
asserting.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2629
2004-08-30 19:36:42 +00:00
Tom Hughes
8cec8a36cc When delivering SIGFPE make sure we patch up si_addr in any siginfo
structure to match the address of the instruction in the client program
which caused the fault.

CCMAIL: 88115-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2623
2004-08-26 23:09:26 +00:00
Tom Hughes
22681c7c0a Include the filename in the system call trace for the access syscall.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2622
2004-08-26 12:26:27 +00:00
Tom Hughes
799e526298 If we return from a signal handler to a thread that was waiting to
rendezvous with another thread before the signal arrived then check
whether the rendezvous is now complete or we may deadlock.

CCMAIL: 77369-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2621
2004-08-25 18:58:04 +00:00
Nicholas Nethercote
3df220384a Change things so that stage2's location is controlled by a single variable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2620
2004-08-25 16:16:56 +00:00
Nicholas Nethercote
2f53ead94d Fix problem with brk(). Thanks to Paull Mackerras for the patch.
Added a regression test for it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2619
2004-08-25 13:43:44 +00:00
Nicholas Nethercote
cfebbd9108 Fix symlinking -- the old code worked, but worked for the wrong reason; the
bit before "$(subdir)" has to specify the path from .in_place/ to the root.
It just so happened that $(top_builddir) was the same for all directories at
the same level in the hierarchy as .in_place/ (ie. one deep).

(I haven't bothered changing it in all the tool Makefile.am files, because I'll
do that when I factor out all their common bits into a single file, be it
before or after 2.2.0 is released.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2616
2004-08-25 11:57:21 +00:00
Nicholas Nethercote
0db27515b1 Putting "dist_" in front of a "_DATA" variable means it is included in "make
dist".  This avoids the need to put it in "EXTRA_DIST", and saves a few lines
in all the docs Makefile.am files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2614
2004-08-25 11:40:07 +00:00
Tom Hughes
7b91de196c The size passed to VG_(st_mkfloat) should be in bytes, not bits.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2610
2004-08-23 23:18:57 +00:00
Tom Hughes
fa8a87d6c0 Added code to decode a number of additional negative type numbers
in STABS debug information based on the stabs specification at:

  http://sources.redhat.com/cygwin/stabs.html

CCMAIL: 85811-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2609
2004-08-23 22:29:31 +00:00
Robert Walsh
bd3e480bb3 Add explanatory comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2607
2004-08-23 18:15:12 +00:00
Robert Walsh
0b909972be Fix to allow 32-bit Valgrind to run on AMD64 boxes. Note: this does
NOT allow Valgrind to work with 64-bit executables - only with 32-bit
executables on an AMD64 box.

VG_(valgrind_end) now has a slightly different meaning to all the other
VG_(*_end) vars -- ie. it names the last byte, whereas the others go
one byte past the end.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2606
2004-08-23 18:13:16 +00:00
Tom Hughes
297462c18e Don't version the sem_xxx symbols that have more than one version in
glibc - it doesn't matter for valgrind as we only have one version and
by not versioning them we work no matter what version is asked for.

CCMAIL: 86289-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2605
2004-08-23 18:05:51 +00:00
Nicholas Nethercote
0ae90953a0 Here's a couple more I missed in the last commit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2604
2004-08-23 16:39:42 +00:00
Nicholas Nethercote
7bb94df98b Use SYSNO and res, etc, instead of tst->m_eax in a few places to make things
less x86-specific.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2603
2004-08-23 16:36:09 +00:00
Nicholas Nethercote
cd1a723aa0 Makefile.am minor correction
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2602
2004-08-23 15:42:21 +00:00
Nicholas Nethercote
a2b3609df7 Small step in factoring out arch-specific code: replace
__attribute((regparm(n))) with REGPARM(n) everywhere.  REGPARM() is defined in
vg_skin.h, but will eventually be defined separately for each arch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2601
2004-08-23 15:06:23 +00:00
Nicholas Nethercote
538305709f Removing the example tool 'example' -- it's almost identical to Nulgrind,
except it doesn't actually get built and so ex_main.c and the Makefile.am tend
to get out of date.  Changed the docs to refer to Nulgrind as the example tool
for if you start writing a new one.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2599
2004-08-23 14:15:29 +00:00
Nicholas Nethercote
3fb236f86d Fix bug, courtesy of Paul Mackerras: when giving find_map_space an address
lower than that of any existing segment, it got it wrong due to the confusing
SkipList API.  I wonder how many more bugs like that there are...?


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2596
2004-08-23 09:28:37 +00:00
Tom Hughes
57d86ee4de More fixes for the cancellation wrappers in libpthread - if looking
for the original function with RTLD_NEXT doesn't work then try looking
for the __libc_ version of the function the RTLD_DEFAULT instead.

The reason for this is that, contrary to the dlsym documentation, it
seems that RTLD_NEXT doesn't always seem to find the definition that
would have been used if it weren't for the override. This is particularly
common wihen libpthread is pulled in implicitly by a dependency from
another library.

This should hopefully fix bug #85658.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2595
2004-08-22 22:56:25 +00:00
Tom Hughes
3314d48b5c Add support for a --time-stamp option that causes each message output
by valgrind to include a time stamp. This fixes bug #70587.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2594
2004-08-21 11:10:44 +00:00
Nicholas Nethercote
ef872d393b Rename VGOFF_(tls) to VGOFF_(tls_ptr) to make it clear it's not the same as
ThreadState.tls.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2593
2004-08-18 23:11:45 +00:00
Nicholas Nethercote
40d9602352 Cleaned up the syscall wrappers a bit:
- corrected a few mistakes, eg. when printing them out, in prototypes
- made printing of "%p(%s)" args consistent
- removed 'sizeof_struct_user_fpxregs_struct' from PRE(ptrace)/POST(ptrace)
- allowing for the two different versions of open()


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2591
2004-08-18 14:37:17 +00:00
Tom Hughes
2ff805b932 Minor rejigging of includes to help compilation on Debian systems.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2590
2004-08-18 08:11:34 +00:00
Nicholas Nethercote
b35a98059b getgroups can't block
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2589
2004-08-17 13:26:52 +00:00
Tom Hughes
1e3b61b6cf Add support for the parallel port ioctls.
CCMAIL: 86407-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2588
2004-08-16 19:46:55 +00:00
Tom Hughes
7995acbe95 Treat a thread which is waiting to be reaped (ie one with a status
of VgTs_WaitJoiner) as non-existent for the purposes of cancellation.

This ensures that pthread_cancel returns ESRCH instead of trying to
cancel the thread, which would lead to the thread cleanup code being
run twice.

CCMAIL: 86730-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2587
2004-08-15 14:34:02 +00:00
Tom Hughes
c8932f4011 Back out yesterday's change to the symbol versioning in the pthread
library - it seems that I misunderstood hom the versioning works and
a system looking for a GLIBC_PRIVATE version of the clock routines
would not find the GLIB_2.2.3 one even with the inheritance. It only
seemed to be working on glibc 2.3 systems because of the version
overrides in the source code, but it failed on glibc 2.2.5 systems.

The new approach is to explicity create two versions of the routines
in question, one with a version of GLIBC_2.2.3 and one with a version
of GLIBC_PRIVATE instead. This has been tested on six different systems
and appears to work everywhere.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2586
2004-08-15 14:11:12 +00:00
Tom Hughes
546afbe696 Add support for the POSIX message queue system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2585
2004-08-14 18:52:27 +00:00
Tom Hughes
42c7adce45 Maek init_global_thread_specific_state as a constructor to try and ensure
that it is called as soon as libpthread.so is loaded even if pthread_create
is never called.

This ensures that pthread_exit will work correctly, and I think will also
cure the famous memory leak in the pthread specifics for the main thread.

CCMAIL: 86730-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2584
2004-08-14 15:37:59 +00:00