85 Commits

Author SHA1 Message Date
Bart Van Assche
d677d75fb2 Ported to Win32. Tested that both RUNNING_ON_VALGRIND and VALGRIND_PRINTF()
work with MinGW and Microsoft Visual Studio. Should close #210935.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11295
2010-08-27 10:05:27 +00:00
Julian Seward
3195fb3d5d Add a new client request, VALGRIND_MAP_IP_TO_SRCLOC, so that clients
can query their own debug info.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11269
2010-08-20 18:22:07 +00:00
Julian Seward
9b0574dff8 Update copyright dates to 2010.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11121
2010-05-03 21:37:12 +00:00
Julian Seward
55089819eb Rename preprocessor macro __VALGRIND__ to __VALGRIND_MAJOR__ and add
comments.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11105
2010-04-19 08:43:26 +00:00
Julian Seward
dfdf90ef27 Make the version number available in the valgrind.h headers, so
clients can do version-specific client requests.  This is something we
should have done long ago.  Still needs a way to regtest this, to
check that the embedded version matches what's stated in configure.in.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11061
2010-03-03 22:57:47 +00:00
Julian Seward
eb5d6433bd Followup fix to r11006. Don't pass va_list by value through client
requests, since there's no guarantee it is the same size as a machine
word.

This renames the private client request VG_USERREQ__INTERNAL_PRINTF to
VG_USERREQ__INTERNAL_PRINTF_VALIST_BY_REF and changes the
argument-passing accordingly.

The public client requests VG_USERREQ__PRINTF and
VG_USERREQ__PRINTF_BACKTRACE are now deprecated, and handled only in
the case where sizeof(UWord) == sizeof(va_list).  In all other cases V
will now print a detailed error message and abort.  This breaks binary
compatibility of apps compiled using VALGRIND_PRINTF and
VALGRIND_PRINTF_BACKTRACE, but that's not easy to avoid.

VG_USERREQ__PRINTF and VG_USERREQ__PRINTF_BACKTRACE are now replaced
by VG_USERREQ__PRINTF_VALIST_BY_REF and
VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF.  The end-user macros
VALGRIND_PRINTF and VALGRIND_PRINTF_BACKTRACE have been adjusted to
use these new requests instead.

Overall result is that source level compatibility of code using
VALGRIND_PRINTF{,_BACKTRACE} is retained, but binary level
compatibility may be broken, necessitating a rebuild of code using
these macros.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11032
2010-01-28 15:23:54 +00:00
Julian Seward
a72ca74730 Don't assume that va_list can be casted to an unsigned word. Fixes
the build on arm-linux with gcc-4.4 or later.  Patch from Dmitry
Zhurikhin.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11006
2010-01-04 01:01:02 +00:00
Julian Seward
183f9f334f Tidy up determination of the PLAT_ macros a bit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10989
2010-01-02 10:37:58 +00:00
Julian Seward
e9de458500 Merge from branches/ARM, all parts of the ARM-Linux port except for
the changes to do with reading and using ELF and DWARF3 info.
This breaks all targets except amd64-linux and x86-linux.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10982
2010-01-01 11:59:33 +00:00
Nicholas Nethercote
6fd1b000e4 Allow custom blocks to overlap with malloc blocks. Fixes bug 100628.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10765
2009-08-10 07:36:54 +00:00
Nicholas Nethercote
5dfe01a847 With the recent VG_(message) change,
VALGRIND_{PRINTF,PRINTF_BACKTRACE,INTERNAL_PRINTF} were no longer appending
newlines.  This meant that --trace-malloc=yes spewed everything onto a
single line, among other things.

Rather than adding the newline back in, I chose to offically change their
behaviour to not add the newlines, as this is more flexible (and the reason
for the underlying VG_(message) change).  I updated all the relevant places
I could find.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10694
2009-08-03 01:38:56 +00:00
Nicholas Nethercote
2a7a73345f Ignore MALLOCLIKE_BLOCK/FREELIKE_BLOCK if addr==0. Fixes bug 137073. DRD
now has its own copy of custom_alloc.c which is a little different to
Memcheck's;  making them both work with the same version was too difficult.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10455
2009-07-15 02:31:45 +00:00
Nicholas Nethercote
50ea939ae1 Attempt to improve the {MALLOC,FREE}LIKE_BLOCK documentation, based on
seeing them misapplied on a real-world example.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10420
2009-07-09 23:35:44 +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
338d03ec6c Add some extra CALL_FN_V_* macros. Copied from the DARWIN branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9919
2009-05-19 01:24:50 +00:00
Nicholas Nethercote
a3dfa6672b Factor out the name of the libpthread library. Also fix a minor stack trace
bogon.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9832
2009-05-11 08:01:09 +00:00
Julian Seward
779bbb61c6 Add support for reading Windows PDB debug info (symbols and line
numbers) when Valgrind is running Wine.  Modified version of a
patch by John Reiser (vgsvn+wine-load-pdb-debuginfo.patch) with
extensions to read a second format of line number tables.

Wine uses a new client request, VG_USERREQ__LOAD_PDB_DEBUGINFO,
to tell Valgrind when to read PDB info.  Wine's implementation
of module loading is vastly different from that used by
ld-linux.so, and it is too difficult to recognize what is going
on just by observing the calls to mmap and mprotect.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9580
2009-04-22 22:42:10 +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
cfb40cbf6f Add missing __extension__ markings on a couple of clreqs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9230
2009-02-23 02:08:24 +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
Nicholas Nethercote
d17c45b9d1 Document flakiness of NON_SIMD_CALL* in comments and the manual.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7279
2007-12-05 21:51:50 +00:00
Julian Seward
0babc91f2f Merge r6806 from branches/THRCHECK:
Fix longstanding error in the amd64-linux function-wrapping macros:
protect the caller's red zone across the hidden call.  All rather
nasty as explained in big comment.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7120
2007-11-09 23:09:50 +00:00
Julian Seward
172505c978 Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488
2007-01-08 06:01:59 +00:00
Julian Seward
99eb8260a2 Get rid of the use of explicit register variables in the ppc32-linux
magic macros.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6386
2006-12-08 21:29:46 +00:00
Nicholas Nethercote
688b71e4a1 Clarify NON_SIMD_CALL instructions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6362
2006-11-20 22:02:40 +00:00
Nicholas Nethercote
fad24de4bc Move VG_BUGS_TO to pub_tool_basics.h so that Nulgrind need not import
pub_tool_libcassert.h.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6320
2006-10-18 21:50:26 +00:00
Julian Seward
44fb84cd6e Merge r6125: Function-wrapping macros and associated stuff, for AIX.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6262
2006-10-17 01:32:48 +00:00
Julian Seward
a81be9f483 A memory pool update from Graydon Hoare.
Here's an update to the mempool move / change client requests and sanity 
checking. The following changes are present:

   - Added one more (hopefully last) client request, a predicate to
     test whether a mempool anchor address is currently tracked.
     It turns out mozilla's arena-using code is sufficiently inconsistent
     in its assumptions that it's very difficult to phrase the valgrind
     client-request annotations without this request. Namely: sometime
     arena-init and arena-free operations are assumed to be idempotent.

   - Fixed a very rapid tool-memory leak in the mempool sanity check
     routine. The previous version of the patch I posted would use all
     memory even on my Very Beefy Test Machine within ~15 minutes of
     browsing with firefox.

   - Added a little logging code to print the counts of pools and chunks
     active every ~10000 sanity checks, when running with -v.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6197
2006-10-05 17:59:23 +00:00
Julian Seward
7f29782f67 Make this file a bit more 'gcc -ansi -pedantic' friendly (bug #132722).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6036
2006-08-28 21:13:06 +00:00
Julian Seward
7586467ab5 Add a mempool-trimming client request (Graydon Hoare).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5992
2006-07-28 00:06:37 +00:00
Julian Seward
ad67fd79fe Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954
2006-06-05 23:21:15 +00:00
Nicholas Nethercote
74ef44f79a Add a helpful comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5949
2006-06-02 22:32:02 +00:00
Julian Seward
13ef1e1c45 Recent GCCs (3.4+ at least) optimize static unused functions out, so
making VALGRIND_PRINTF and VALGRIND_PRINTF_BACKTRACE static and
attribute unused proved to be much better than always compiling it as
exported weak function.  (Jakub Jelinek)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5845
2006-04-12 17:15:35 +00:00
Nicholas Nethercote
7852ab7f22 Make the BSD-style license notices slightly more accurate.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5803
2006-03-31 12:05:04 +00:00
Nicholas Nethercote
3d12e0e9db Terminology change: previously in Memcheck we had the four states:
noaccess, writable, readable, other

Now they are:

   noaccess, undefined, defined, partdefined

As a result, the following names:

   make_writable, make_readable,
   check_writable, check_readable, check_defined

have become:

   make_mem_undefined, make_mem_defined,
   check_mem_is_addressable, check_mem_is_defined, check_value_is_defined

(and likewise for the upper-case versions for client request macros).
The old MAKE_* and CHECK_* macros still work for backwards compatibility.

This is much better, because the old names were subtly misleading.  For
example:

  - "readable" really meant "readable and writable".
  - "writable" really meant "writable and maybe readable, depending on how
    the read value is used".
  - "check_writable" really meant "check writable or readable"

The new names avoid these problems.

The recently-added macro which was called MAKE_DEFINED is now
MAKE_MEM_DEFINED_IF_ADDRESSABLE.

I also corrected the spelling of "addressable" in numerous places in
memcheck.h.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5802
2006-03-31 11:57:59 +00:00
Julian Seward
6cc171e050 Add missing CALL_FN_* macros for ppc64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5758
2006-03-12 16:48:14 +00:00
Julian Seward
fb374bd1f5 Add CALL_FN_* missing cases for ppc32-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5754
2006-03-12 13:39:15 +00:00
Julian Seward
c4a8d96725 Complete CALL_FN_W_* wrappers for amd64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5748
2006-03-11 16:19:14 +00:00
Julian Seward
b0c46d47bd Add missing x86-linux CALL_FN_W_11W macro.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5745
2006-03-11 12:57:41 +00:00
Julian Seward
a701e9d4c4 Add a couple of missing cases. Function wrapping is really ugly :-(
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5734
2006-03-09 19:06:23 +00:00
Julian Seward
7622aee188 Add a missing case.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5656
2006-02-18 21:13:29 +00:00
Julian Seward
72dd07b7ef Change the number of client request args from 4 to 5 as that may
be useful in future.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5603
2006-02-01 14:59:42 +00:00
Julian Seward
332b20ecef Make fn wrapping work again on ppc32-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5573
2006-01-20 16:46:34 +00:00
Julian Seward
e6ffa0ee09 x86 function wrapping fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5571
2006-01-20 15:46:46 +00:00
Julian Seward
83c10ad5b7 Make amd64 function wrapping work again following recent changes.
Includes expected outputs for wrap8 for the non ppc64-linux case.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5570
2006-01-20 15:17:20 +00:00
Julian Seward
6af183ac21 Changes to make function wrapping work better on ppc64-linux:
- when recording the non-redirected address in guest_NRADDR, also
  snapshot the current R2 value, as that will be needed to run the
  original safely

- As a consequence, the original-function information extracted by
  VALGRIND_GET_ORIG_FN is different on ppc64-linux (2 words) from
  all other platforms (1 word).  So change the type of it from
  void* to a new type OrigFn which can be defined differently for
  each platform.

- Change the CALL_FN_* macros for ppc64-linux to save/restore
  R2 values appropriately.

- ppc64-linux: detect overflow/underflow of the redirect stack
  and bring Valgrind to a halt if this happens

- Update VG_CLREQ_SZB for ppc32/64 (was out of date).





git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5569
2006-01-20 14:31:57 +00:00
Julian Seward
61c4ef43b3 ppc64-linux function wrapping support (does not work properly)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5529
2006-01-17 01:49:37 +00:00
Julian Seward
5e77fedd75 Fix more ppc64-linux function wrapping and symbol-table bits and pieces.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5523
2006-01-12 21:15:35 +00:00
Julian Seward
f9a9e03c7a Merge in function wrapping support from the FNWRAP branch. That
branch hereby becomes inactive.  This currently breaks everything
except x86; fixes for amd64/ppc32 to follow.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5520
2006-01-12 12:32:32 +00:00
Julian Seward
8ba9a34088 Add framework for ppc64 support. Apologies in advance for the
inevitable breakage to other platforms.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5250
2005-11-29 13:05:56 +00:00