3365 Commits

Author SHA1 Message Date
Nicholas Nethercote
97b2ffd409 Fix a problem with r10384: it was failing to read the ELF header if the
executable was less than 4096 bytes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10387
2009-06-30 06:06:14 +00:00
Josef Weidendorfer
1191ffa0eb Change demangler to not use excessive space from stack
Replaces alloca with xmalloc calls.
This should fix bug 197988.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10385
2009-06-29 16:13:25 +00:00
Nicholas Nethercote
07a1251a20 Make the Linux launcher more like the Darwin one in how it reads the
executable headers.  This means it no longer crashes on an empty executable.
Fixes bug 156065.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10384
2009-06-29 06:57:30 +00:00
Nicholas Nethercote
a95af1babe Add a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10383
2009-06-29 05:19:15 +00:00
Nicholas Nethercote
04e9b16dea An fd in the Darwin launcher wasn't being closed.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10379
2009-06-26 04:35:51 +00:00
Nicholas Nethercote
26daa53d28 In VG_(get_changed_segments) use dynamic memory allocation rather than
static memory allocation to avoid hardwiring an upper limit on CSS_SIZE.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10374
2009-06-24 08:32:42 +00:00
Nicholas Nethercote
5e7562af08 Add support for various aio_*() syscalls on Darwin. With them, Quicktime
runs, albeit incredibly slowly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10371
2009-06-24 06:25:36 +00:00
Nicholas Nethercote
7eb329d028 Support and test mincore() on Darwin.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10368
2009-06-24 04:15:29 +00:00
Nicholas Nethercote
03e20d86b7 Enable mincore() on AMD64/Linux. Hopefully fixes bug 197591.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10367
2009-06-24 04:02:19 +00:00
Nicholas Nethercote
de25e03eed Abort if a dir is given to --suppressions. Fixes bug 197456.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10366
2009-06-24 03:49:19 +00:00
Nicholas Nethercote
b05a2a18d7 This commit merges the BUILD_TWEAKS branch onto the trunk. It has the
following improvements:

- Arch/OS/platform-specific files are now included/excluded via the
  preprocessor, rather than via the build system.  This is more consistent
  (we use the pre-processor for small arch/OS/platform-specific chunks
  within files) and makes the build system much simpler, as the sources for
  all programs are the same on all platforms.

- Vast amounts of cut+paste Makefile.am code has been factored out.  If a
  new platform is implemented, you need to add 11 extra Makefile.am lines.
  Previously it was over 100 lines.

- Vex has been autotoolised.  Dependency checking now works in Vex (no more
  incomplete builds).  Parallel builds now also work.  --with-vex no longer
  works;  it's little use and a pain to support.  VEX/Makefile is still in
  the Vex repository and gets overwritten at configure-time;  it should
  probably be renamed Makefile-gcc to avoid possible problems, such as
  accidentally committing a generated Makefile.  There's a bunch of hacky
  copying to deal with the fact that autotools don't handle same-named files
  in different directories.  Julian plans to rename the files to avoid this
  problem.

- Various small Makefile.am things have been made more standard automake
  style, eg. the use of pkginclude/pkglib prefixes instead of rolling our
  own.

- The existing five top-level Makefile.am include files have been
  consolidated into three.

- Most Makefile.am files now are structured more clearly, with comment
  headers separating sections, declarations relating to the same things next
  to each other, better spacing and layout, etc.

- Removed the unused exp-ptrcheck/tests/x86 directory.

- Renamed some XML files.

- Factored out some duplicated dSYM handling code.

- Split auxprogs/ into auxprogs/ and mpi/, which allowed the resulting
  Makefile.am files to be much more standard.

- Cleaned up m_coredump by merging a bunch of files that had been
  overzealously separated.

The net result is 630 fewer lines of Makefile.am code, or 897 if you exclude
the added Makefile.vex.am, or 997 once the hacky file copying for Vex is
removed.  And the build system is much simpler.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10364
2009-06-24 00:37:09 +00:00
Nicholas Nethercote
e4cbc57ed9 Make the sys_newlstat wrapper more like those of similar *stat() syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10339
2009-06-15 07:43:50 +00:00
Nicholas Nethercote
d48af010b9 Add wrappers for shmat() and shmdt() on Darwin. Fixes bug 191271.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10297
2009-06-10 23:26:13 +00:00
Nicholas Nethercote
7a095f31f3 Added a wrapper and test for exchangedata() on Darwin. Fixes bug 195860.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10295
2009-06-10 22:58:27 +00:00
Nicholas Nethercote
a048647a9a Implement and test wrappers for lstat_extended, stat64_extended,
lstat64_extended, and improve the existing wrapper for stat_extended.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10291
2009-06-10 06:13:34 +00:00
Nicholas Nethercote
aa21ae3de1 Darwin syscall wrapper cleanups:
- Put Darwin syscall DECL_TEMPLATEs in syscall order.
- Removed the "sys_" prefix from Darwin-specific wrappers, it's not
  necessary.  Renamed a couple of other wrappers similarly.
- Removed the sys_fcntl64 Darwin wrapper, it was unused.
- Improved some code layout.
Overall this removes 6 "DDD"/"GrP" fixme comments.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10290
2009-06-10 04:11:56 +00:00
Nicholas Nethercote
ae530719e6 Add wrappers for sem_wait and sem_trywait on Darwin. Also change the layout
of some Darwin syscall stuff.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10288
2009-06-10 01:23:26 +00:00
Nicholas Nethercote
2a9e26c733 Handle shmctl on Darwin. From bug 191271.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10287
2009-06-09 23:44:42 +00:00
Nicholas Nethercote
4ddfee7723 Fix URB ioctl handling. Patch from Hector Martin (bug 191095).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10286
2009-06-09 23:03:02 +00:00
Nicholas Nethercote
17ae73a356 Avoid recursion in VG_(exit).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10285
2009-06-09 22:46:32 +00:00
Nicholas Nethercote
a01f086879 Handle another Linux ioctl. Patch from Jay Foad.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10284
2009-06-09 22:31:00 +00:00
Nicholas Nethercote
a4a24f0c4f Abort if a --log-file filename begins with a '~'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10281
2009-06-09 00:50:45 +00:00
Julian Seward
4ece7c2449 x86-linux: sys_set_thread_area: don't allocate GDT entry number zero,
and reject attempts to use it.  This is because the hardware does not
allow entry zero to be used, and apparently doing so confuses some
code (perhaps Windows apps running on Wine).  Derived from a patch by
John Reiser.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10251
2009-06-05 13:17:31 +00:00
Nicholas Nethercote
3829cffbcf Increase a hard limit that was reached in the wild.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10250
2009-06-05 05:28:17 +00:00
Nicholas Nethercote
2314fe1acc For no apparent reason, the machine-dependent syscall
thread_fast_set_cthread_self was being called pthread_set_self.  This commit
fixes this.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10249
2009-06-05 01:33:16 +00:00
Nicholas Nethercote
5f8f34f8c0 Don't print stack traces by default for unhandled syscalls -- it's not that
useful but screws up the 'scalar' tests.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10219
2009-06-03 07:17:07 +00:00
Nicholas Nethercote
2a7d944c27 A number of changes relating to syscall numbering:
- Introduced VG_SYSNUM_STRING and VG_SYSNUM_STRING_EXTRA which factor out
  differences in the way syscall numbers are printed on different platforms.
  This gets rid of seven "DDD" fixme-style comments.

- This also meant that Darwin syscall numbers are now printed in a
  non-ambiguous way -- previously Unix, machine-dependent and diagnostic
  syscalls were all printed the same way, even though their numbers overlap.
  Now each number is prefixed with "unix", "mdep", etc.  And Mach trap
  numbers aren't printed as negative numbers now that they have a "mach"
  prefix.

- Split each of pub_core_vkiscnums.h and pub_tool_vkiscnums.h into two
  parts, one suitable for inclusion in asm files, one suitable for inclusion
  in C files;  in both cases the latter includes the former.  This makes
  this module more like other modules that have asm-only components (eg.
  m_transtab);  it also allows the hacky VG_IN_ASSEMBLY_SOURCE macros and
  tests to be removed.

- Removed some of the VG_DARWIN_SYSNO_* macros that were no longer needed,
  and renamed some of the existing ones to make their meanings clearer.

- Added comments on the encoding of Darwin syscall numbers so it's
  possible for mortals to understand without reading the kernel code..



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10218
2009-06-03 06:50:06 +00:00
Nicholas Nethercote
8c3b7ff600 Back out r10197--r10200 and r10202--r10203. I'm going to put them, and
further, related changes, on a branch instead.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10204
2009-06-02 06:54:57 +00:00
Nicholas Nethercote
1f9f4f8562 Move some stuff around; no functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10203
2009-06-02 05:27:07 +00:00
Nicholas Nethercote
139e8dcd17 Avoid repetitive cut+paste code for libreplacemalloc_toolpreload.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10202
2009-06-02 05:19:54 +00:00
Nicholas Nethercote
13f159b3a2 Avoid repetitive cut+paste code relating to vgpreload_core.so.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10200
2009-06-02 05:04:08 +00:00
Nicholas Nethercote
cd5d3a783b Add some header comments to break up the file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10199
2009-06-02 04:58:03 +00:00
Nicholas Nethercote
9b5ad99909 Avoid repetitive cut+paste code for LIBVEX.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10198
2009-06-02 04:52:45 +00:00
Nicholas Nethercote
216e73fe38 Avoid repetitive cut+paste code for AM_CPPFLAGS.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10197
2009-06-02 04:46:46 +00:00
Julian Seward
07e9355969 Fix compile breakage in is_systemish_library_name introduced in r10173.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10188
2009-05-31 19:59:29 +00:00
Julian Seward
b2568db819 is_systemish_library_name: add "/opt" and "/sw" to the list of places
where we shouldn't auto-run dsymutil.  (Luc Bourhis).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10173
2009-05-31 08:31:06 +00:00
Julian Seward
44d851851e Reinstate an include needed on ppc{32,64}-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10161
2009-05-28 17:15:41 +00:00
Tom Hughes
cb02702334 Add support for AT_RANDOM to keep glibc happy when it is built
to assume kernel 2.6.29 or later. Closes #194429.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10160
2009-05-28 12:51:24 +00:00
Nicholas Nethercote
07045477ca Merge the DARWIN branch onto the trunk.
I tried using 'svn merge' to do the merge but it did a terrible job and
there were bazillions of conflicts.  So instead I just took the diff between
the branch and trunk  at r10155, applied the diff to the trunk, 'svn add'ed
the added files (no files needed to be 'svn remove'd) and committed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10156
2009-05-28 01:53:07 +00:00
Nicholas Nethercote
ff9fe6eb81 DARWIN sync: timeval.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10150
2009-05-25 01:48:59 +00:00
Nicholas Nethercote
f7b44686d5 DARWIN sync: add a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10149
2009-05-25 01:48:32 +00:00
Nicholas Nethercote
8fde04297b Changing VG_MALLOC_MIN_SZB to 16 on some platforms broke heap profiling.
This fixes it by changing the size of a cost centre from ULong to
VG_MALLOC_MIN_SZB.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10136
2009-05-24 23:36:50 +00:00
Nicholas Nethercote
43c9f484e0 DARWIN sync: sys_truncate64 and sys_ftruncate64 wrappers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10134
2009-05-24 23:02:55 +00:00
Nicholas Nethercote
93ab20a3de DARWIN sync: remove redundant check (it's done again in pre_mem_sock_addr()).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10133
2009-05-24 22:45:33 +00:00
Nicholas Nethercote
27ff9aaf29 DARWIN sync: sys_open wrapper.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10131
2009-05-24 22:32:33 +00:00
Nicholas Nethercote
63d3d86e21 DARWIN sync: sys_readlink layout.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10121
2009-05-23 01:51:54 +00:00
Nicholas Nethercote
e6f07f20d3 DARWIN sync: remove '.' from some field names for consistency, and factor
out some variables.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10119
2009-05-23 01:18:44 +00:00
Nicholas Nethercote
9633a4c11d DARWIN sync: all the timeval stuff
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10106
2009-05-22 08:12:46 +00:00
Nicholas Nethercote
3f5f690a32 DARWIN sync: comment and braces.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10102
2009-05-22 07:09:03 +00:00
Nicholas Nethercote
83abfcbfa0 DARWIN sync: change the 3rd arg of VG_(fcntl).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10101
2009-05-22 07:08:12 +00:00