168 Commits

Author SHA1 Message Date
Bart Van Assche
74246448f4 Removed dependency of include/pub_tool_basics.h on config.h.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10972
2009-12-29 16:56:18 +00:00
Julian Seward
3a888ce7eb Fix type in r10951. Not sure why this didn't cause a compilation
error, but least on ppc32-linux it didn't.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10956
2009-11-25 13:57:47 +00:00
Tom Hughes
41f4259ea8 Rename LOHI64 to MERGE64 and make it work correctly on big endian
platforms. Also add MERGE64_FIRST and MERGE64_SECOND macros to help
produce the right argument names in error messages on big/little
endian platforms.

Based on patch from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10951
2009-11-25 11:24:00 +00:00
Julian Seward
426c137045 New flag: --trace-children-skip=patt1,patt2,etc
Specifies a comma-separated list of executable-names
(with "*" and "?" wildcards allowed) that should not be traced into
even when --trace-children=yes.  Modified version of a patch
from Bill Hoffman.  Fixes #148932.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10927
2009-11-05 08:55:13 +00:00
Bart Van Assche
82e0033fdd Switched back from dynamic detection of whether the proc filesystem
is mounted to compile-time logic in order to minimize the differences
in behavior with Valgrind version 3.5.0.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10868
2009-08-25 20:15:41 +00:00
Bart Van Assche
772166c146 Renamed the function VG_(have_proc_filesystem)() into
VG_(is_procfs_mounted)(). The old name was derived from the name
of the preprocessor macro HAVE_PROC while the new name is a more
accurate description of what this function does.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10867
2009-08-25 17:34:58 +00:00
Bart Van Assche
6b9dcdcd97 The configure-time test whether the proc filesystem is mounted (introduced
in r10156) broke cross-compilation. This patch converts the configure-time
test into a runtime test. Should fix bug #204843.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10860
2009-08-23 09:53:27 +00:00
Julian Seward
e7dde85a24 Merge coregrind/ changes from branches/MESSAGING_TIDYUP r10464.
This commit tidies up and rationalises what could be called the
"messaging" system -- that part of V to do with presenting output to
the user.  In particular it brings significant improvements to XML
output.

Changes are:

* XML and normal text output now have separate file descriptors,
  which solves longstanding problems for XML consumers caused by
  the XML output getting polluted by unexpected non-XML output.

* This also means that we no longer have to hardwire all manner
  of output settings (verbosity, etc) when XML is requested.

* The XML output format has been revised, cleaned up, and made
  more suitable for use by error detecting tools in general
  (various Memcheck-specific features have been removed).  XML
  output is enabled for Ptrcheck and Helgrind, and Memcheck is
  updated to the new format.

* One side effect is that the behaviour of VG_(message) has been
  made to be consistent with printf: it no longer automatically
  adds a newline at the end of the output.  This means multiple
  calls to it can be used to build up a single line message; or a
  single call can write a multi-line message.  The ==pid==
  preamble is automatically inserted at each newline.

* VG_(message)(Vg_UserMsg, ..args..) now has the abbreviated form
  VG_(UMSG)(..args..); ditto VG_(DMSG) for Vg_DebugMsg and
  VG_(EMSG) for Vg_DebugExtraMsg.  A couple of other useful
  printf derivatives have been added to pub_tool_libcprint.h,
  most particularly VG_(vcbprintf).

* There's a small change in the core-tool interface to do with
  error handling: VG_(needs_tool_errors) has a new method
  void (*before_pp_Error)(Error* err)  which, if non-NULL, is
  called just before  void (*pp_Error)(Error* err).  This is to
  give tools the chance to look at errors before any part of them
  is printed, so they can print any XML preamble they like.

* coregrind/m_errormgr.c has been overhauled and cleaned up, and
  is a bit simpler and more commented.  In particular pp_Error
  and VG_(maybe_record_error) are significantly changed.

The diff is huge, but mostly very boring.  Most of the changes
are of the form

-   VG_(message)(Vg_UserMsg, "this is a message %d", n);
+   VG_(message)(Vg_UserMsg, "this is a message %d\n", n);

Unfortunately as a result of this, it touches a large number
of source files.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10465
2009-07-15 14:48:32 +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
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
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
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
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
b4dbd225dd DARWIN sync: add ML_({PRE,POST}_unknown_ioctl).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10089
2009-05-22 00:15:06 +00:00
Nicholas Nethercote
8f020ede95 Merge r10085, r10086 (post-fork handling) from the DARWIN branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10087
2009-05-21 23:59:34 +00:00
Nicholas Nethercote
7b2a259bea DARWIN sync: pread64 and pwrite64 wrappers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9971
2009-05-19 06:50:37 +00:00
Nicholas Nethercote
131ab00744 Merged non-Darwin-specific parts of r9397,r9423,r9490, 9461, 9462 from the
DARWIN branch.  A big ugly DARWIN/trunk sync commit, mostly to do with
changing the representation of SysRes and vki_sigset_t.  Functionality of
the trunk shouldn't be changed by it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9876
2009-05-18 02:12:08 +00:00
Nicholas Nethercote
3b87b28ca4 Merge r9828 (fix aspacem layering violation) from the DARWIN branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9831
2009-05-10 22:42:19 +00:00
Nicholas Nethercote
fcb90ff490 Merged r9657 (fdleak fixes) from the DARWIN branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9658
2009-04-28 05:35:53 +00:00
Nicholas Nethercote
2001629c3f Updated copyright years.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9344
2009-03-10 22:02:09 +00:00
Nicholas Nethercote
70150c5884 Use "status" as the argname for 'exit' and 'exit_group'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9311
2009-03-03 05:39:23 +00:00
Nicholas Nethercote
da695aa41a atoll() is a terrible function -- you can't do any error checking with it.
Some of our option processing code uses it.  This means that eg.
'--log-fd=9xxx' logs to fd 9, and '--log-fd=blahblahblah' logs to 0 (because
atoll() returns 0 if the string doesn't contain a number!)

It turns out that most of our option processing uses VG_(strtoll*) instead
of VG_(atoll).  The reason that not all of it does is that the
option-processing macros are underpowered -- they currently work well if you
just want to assign the value to a variable, eg:

        VG_BOOL_CLO(arg, "--heap",   clo_heap)
   else VG_BOOL_CLO(arg, "--stacks", clo_stacks)

   else VG_NUM_CLO(arg, "--heap-admin", clo_heap_admin)
   else VG_NUM_CLO(arg, "--depth",      clo_depth)

(This works because they are actually an if-statement, but it looks odd.)

VG_NUM_CLO uses VG_(stroll10).  But if you want to do any checking or
processing, you can't use those macros, leading to code like this:

      else if (VG_CLO_STREQN(9,  arg, "--log-fd=")) {
         log_to            = VgLogTo_Fd;
         VG_(clo_log_name) = NULL;
         tmp_log_fd        = (Int)VG_(atoll)(&arg[9]);
      }

So this commit:
- Improves the *_CLO_* macros so that they can be used in all circumstances.
  They're now just expressions (albeit ones with side-effects, setting the
  named variable appropriately).  Thus they can be used as if-conditions,
  and any post-checking or processing can occur in the then-statement.  And
  malformed numeric arguments (eg. --log-fd=foo) aren't accepted.  This also
  means you don't have to specify the lengths of any option strings anywhere
  (eg.  the 9 in the --log-fd example above).  The use of a wrong number
  caused at least one bug, in Massif.
- Updates all places where the macros were used.
- Updates Helgrind to use the *_CLO_* macros (it didn't use them).
- Updates Callgrind to use the *_CLO_* macros (it didn't use them), except
  for the more esoteric option names (those with numbers in the option
  name).  This allowed getUInt() and getUWord() to be removed.
- Improves the cache option parsing in Cachegrind and Callgrind -- now uses
  VG_(strtoll10)(), detects overflow, and is shorter.
- Uses INT instead of NUM in the macro names, to distinguish better vs. the
  DBL macro.
- Removes VG_(atoll*) and the few remaining uses -- they're wretched
  functions and VG_(strtoll*) should be used instead.
- Adds the VG_STREQN macro.
- Changes VG_BINT_CLO and VG_BHEX_CLO to abort if the given value is outside
  the range -- the current silent truncation is likely to cause confusion as
  much as anything.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9255
2009-02-25 01:01:05 +00:00
Nicholas Nethercote
5aac956e64 Remove a number of unused parameters, found with -Wunused-parameter.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9248
2009-02-24 03:07:37 +00:00
Nicholas Nethercote
87b5e49494 Merge a large chunk of r8949 (the part that moved fcntl and ioctl wrappers
out of syswrap-generic into syswrap-linux) from the DARWIN branch.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9219
2009-02-22 23:00:30 +00:00
Nicholas Nethercote
68b5487a3a Make fcntl and fcntl64 wrappers more consistent.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9217
2009-02-22 22:23:09 +00:00
Nicholas Nethercote
3bfae3eec1 Merged r9185 (fix up getsockopt mess) from the DARWIN branch, minus the
Darwin-specific parts.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9186
2009-02-17 00:23:30 +00:00
Julian Seward
f3523a4a0e Some minor format string fixes for gcc-3.3.3 (SuSE 9.1). Not sure why
later gccs don't complain about these.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9019
2009-01-22 12:24:26 +00:00
Tom Hughes
7e17bfc956 The SG_GET_TIMEOUT ioctl doesn't write to memory - it returns the
timeout via it's return value.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8958
2009-01-15 08:49:09 +00:00
Tom Hughes
9b5365f10d The SG_GET_VERSION_NUM ioctl writes to memory rather than reading it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8957
2009-01-15 08:48:14 +00:00
Julian Seward
2ebd38040f Handle sys_lookup_dcookie on amd64-linux (Andrew Haley). Also take
the opportunity to move the handlers from syswrap-generic.c (which
they certainly aren't) to syswrap-linux.c.  Fixes #175044.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8769
2008-11-16 21:40:54 +00:00
Julian Seward
3a2fbbfafd Add ioctl wrappers for Linux wireless extensions version 22.
Patch from Gwenael Lambrouin.  Fixes #159452.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8734
2008-11-05 16:59:55 +00:00
Julian Seward
fbdd00b6e0 gcc-4.4.0 (snapshot) started complaining about buf.sem_nsems being
uninitialised in get_sem_count().  This makes it quiet.  I am not sure
whether get_sem_count() was correct or not without it (probably was
OK).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8697
2008-10-23 09:46:59 +00:00
Nicholas Nethercote
0cf8a14c70 - Reinstate the 'atfork' from 2.4.0, which was more powerful, and expose it to
tools.
- Factor out 'execv' from 'system' and expose it to tools.

Partly based on a patch from Robert O'Callahan.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8669
2008-10-13 04:19:15 +00:00
Julian Seward
335992d8fc Merge all remaining changes from branches/PTRCHECK. These are some
relatively minor extensions to m_debuginfo, a major overhaul of
m_debuginfo/readdwarf3.c to get its space usage under control, and
changes throughout the system to enable heap-use profiling.

The majority of the merged changes were committed into
branches/PTRCHECK as the following revs: 8591 8595 8598 8599 8601 and
8161.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8621
2008-09-18 18:12:50 +00:00
Julian Seward
832a3d400b Tidy up the wrappers for pread64 and pwrite64, and make these two
syscalls available on ppc64-linux.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8519
2008-08-07 20:29:55 +00:00
Bart Van Assche
8e96150945 Merged FORMATCHECK branch (r8368) to trunk.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8369
2008-07-07 06:49:24 +00:00
Bart Van Assche
bd28f145d5 Moved support for Linux-specific system call sys_init_module from generic to Linux wrappers. Added wrapper for sys_delete_module system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8266
2008-06-21 16:28:24 +00:00
Bart Van Assche
7fbbba6ae4 Make sure the debug information is read before a tool is notified about an mmap() system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8142
2008-05-29 08:52:44 +00:00
Julian Seward
a617a26b86 POST(sys_poll): mark the revents field even when RES==0. Fixes #158425.
(Dave Goodell)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8049
2008-05-12 15:46:34 +00:00
Julian Seward
4cae5c3ed5 Merge branches/OTRACK_BY_INSTRUMENTATION into the trunk. This adds
support to Memcheck for tracking the origin of uninitialised values,
if you use the --track-origins=yes flag.

This currently causes some Memcheck regression tests to fail, because
they now print an extra line of advisory text in their output.  This
will be fixed.

The core-tool interface is slightly changed.  The version number for
the interface needs to be incremented.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7982
2008-05-01 20:24:26 +00:00
Bart Van Assche
e31611fb5c Added support for epoll_pwait(), utimensat(), eventfd(), timerfd() and signalfd(). Fixes bug 160907.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7917
2008-04-26 07:45:10 +00:00
Julian Seward
5679a22410 Update copyright dates ("200X-2007" --> "200X-2008").
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7398
2008-02-11 11:34:59 +00:00