113 Commits

Author SHA1 Message Date
Julian Seward
084b7cb10b Fix #284384 (clang 3.1 -Wunused-value warnings in valgrind.h,
memcheck.h) by changing a bunch of VALGRIND_DO_CLIENT_REQUEST_EXPR
into VALGRIND_DO_CLIENT_REQUEST_STMT for cases where the return value
of the former would be unused.  (Bart Van Assche, bart.vanassche@gmail.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12226
2011-10-24 13:21:57 +00:00
Julian Seward
c96096ab24 Update all copyright dates, from 20xy-2010 to 20xy-2011.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12206
2011-10-23 07:32:08 +00:00
Florian Krohm
92388bd248 Make VALGRIND_DO_CLIENT_REQUEST more user friendly by wrapping
its replacement in do .. while (0).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12199
2011-10-22 15:04:05 +00:00
Bart Van Assche
7dab1bd66a Avoid that using any of the VALGRIND_DISABLE_ERROR_REPORTING,
VALGRIND_ENABLE_ERROR_REPORTING, VALGRIND_DO_ADDED_LEAK_CHECK,
VALGRIND_DO_CHANGED_LEAK_CHECK macros causes gcc 4.6 to print
a warning message about assigning a value to an unused variable.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12110
2011-10-07 09:39:56 +00:00
Julian Seward
0eef127a30 ppc64-linux only: fix incorrect line number reports in client requests
that create stack traces.  Fixes #283243.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12101
2011-10-05 07:39:07 +00:00
Julian Seward
e1567da7c5 Extend the behavioural-equivalence-class mechanism for redirection
functions to include the ability to give a priority to each function,
as well as a tag indicating its behavioural class.  Add logic in
m_redir.c to resolve conflicting redirections with the same eclass but
different priorities by preferring the redirection with the higher
priority.  Use all of the above in mc_replace_strmem.c, to cause a
conflict between redirections for "memcpy" and "memcpy@GLIBC_2.2.5" to
be resolved in favour of the latter (the non-overlap-checking
version).

This is all related to the massive swamp that is #275284.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11991
2011-08-18 13:09:55 +00:00
Julian Seward
be517f6178 Add more infrastructure to be used for fixing #275284 (Valgrind
memcpy/memmove redirection stopped working in glibc 2.14/x86_64), but
don't fix the problem yet.  Should be no end-user visible change.

* in m_redir.c, when processing redirection specifications, consider
  all the names associated with an address, not just the primary name.

* add plumbing to support the notion of "behavioural equivalence class
  tags" of redirect/wrap functions.  These can be used by m_redir to
  resolve some situations in which the available set of redirect
  specifications causes some address to get redirected to two
  different functions.  (Framework is in place, but such resolution is
  not implemented yet.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11984
2011-08-16 09:54:00 +00:00
Bart Van Assche
167922d29b valgrind.h: Remove a superfluous cast. See also #278454.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11913
2011-07-25 08:45:45 +00:00
Julian Seward
42ada29286 Add a new client request and pair of macros,
VALGRIND_{DISABLE,ENABLE}_ERROR_REPORTING, which allow a thread to
temporarily disable reporting of errors it makes.  This is useful for
making Memcheck behave sanely in the presence of some MPI
implementations.  Also mark up libmpiwrap.c accordingly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11910
2011-07-24 16:02:33 +00:00
Julian Seward
ad7de5b336 Delete the AIX5 port. The last release this worked for is 3.4.1,
and then only on AIX 5.2 and 5.3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11842
2011-06-28 07:25:29 +00:00
Julian Seward
2acd297ebe Fix #undefs that are inconsistent with those further up the file,
as spotted by Michael Meeks.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11829
2011-06-24 18:26:11 +00:00
Bart Van Assche
9a36fe677e Get rid of the remaining "set but not used" warnings reported by gcc 4.6 by
swapping the roles of the VALGRIND_DO_CLIENT_REQUEST() and
VALGRIND_DO_CLIENT_REQUEST_EXPR() macros. Also, many __attribute__((unused))
declarations on variables have been eliminated. Closes #269778.

Note: so far this patch has been tested on x86/Linux, amd64/Linux and
ppc64/Linux but not yet on any other supported CPU/OS combination.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11755
2011-05-15 07:04:03 +00:00
Julian Seward
2ee9e90486 Implement a GDB server in Valgrind. See #214909.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11727
2011-05-06 21:02:55 +00:00
Julian Seward
b8a03bdc8e Remove a bunch more warnings generated by gcc-4.6 about dead
assignments ("[-Wunused-but-set-variable]"), in the test suite.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11675
2011-03-28 21:19:00 +00:00
Bart Van Assche
9df672f236 Add VALGRIND_RESIZEINPLACE_BLOCK() and hence close #267819.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11666
2011-03-25 20:07:25 +00:00
Julian Seward
6107fd666c Add a port to IBM z/Architecture (s390x) running Linux -- Valgrind
side components. (Florian Krohm <britzel@acm.org> and Christian
Borntraeger <borntraeger@de.ibm.com>).  Fixes #243404.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11604
2011-03-07 16:05:35 +00:00
Bart Van Assche
c03eab7793 <valgrind/valgrind.h>: Made VALGRIND_PRINTF() and VALGRIND_PRINTF_BACKTRACE() definitions (with NVALGRIND defined) C89-compliant.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11580
2011-03-04 16:55:56 +00:00
Julian Seward
c797ab7f0c Preserve the stack's 16-alignment in x86 and amd64 wrappers.
Fixes #254646.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11461
2010-10-20 15:58:09 +00:00
Julian Seward
a1ae66b03f More unwind fixes for the amd64-linux CALL_FN_*_* macros, as per
bug 243270 comments 47 and 48:
* use __builtin_dwarf_cfa(), not __builtin_frame_address(0), to get the CFA
* use correct register specifier in VALGRIND_CFI_PROLOGUE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11416
2010-10-08 17:43:26 +00:00
Bart Van Assche
b8cadb97c9 Only enable CFI annotations when __GCC_HAVE_DWARF2_CFI_ASM is defined. This should work for all platforms, all gcc versions and with and without -fno-dwarf2-cfi-asm / -fno-asynchronous-unwind-tables. Thanks to Jakub Jelinek for the hint.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11415
2010-10-08 15:54:57 +00:00
Bart Van Assche
c72e780776 valgrind.h is again independent of config.h. Note: __builtin_frame_address()
is available since at least gcc 2.95.3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11414
2010-10-08 06:58:25 +00:00
Julian Seward
321e034815 Fix build failure I introduced in r11408, duh.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11410
2010-10-07 10:46:15 +00:00
Julian Seward
5ecb22a89e Tidy up ifdeffery a bit. (non-functional change)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11408
2010-10-07 10:00:56 +00:00
Julian Seward
db5247b157 Fix build breakage on Darwin resulting from r11402 (see #243270),
by disabling creation of .cfi directives on Darwin, until such time
as someone can figure out how to do this.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11407
2010-10-07 10:00:04 +00:00
Julian Seward
797fe272f2 amd64-linux: add suitable CFI annotations so that unwinding through
the CALL_FN_*_* macros works more reliably.  This is all very fiddly
and is described in a large comment in valgrind.h.  Fixes #243270.
(Evgeniy Stepanov, eugeni.stepanov@gmail.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11402
2010-10-06 22:07:06 +00:00
Bart Van Assche
34c6529193 Fixed an AMD64 bug reported by Evgeniy Stepanov: the order of
VALGRIND_CALL_NOREDIR_RAX and addq $128,%%rsp was wrong in CALL_FN_W_6W().
See also #243270.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11340
2010-09-05 12:10:25 +00:00
Bart Van Assche
e79a688a66 Refactoring: introduced new macro VALGRIND_DO_CLIENT_REQUEST_EXPR() and used that macro to reimplement RUNNING_ON_VALGRIND.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11317
2010-09-02 09:33:02 +00:00
Bart Van Assche
661ab8260d Suppressed a few warnings reported by the Microsoft C Compiler.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11314
2010-09-01 10:18:36 +00:00
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