731 Commits

Author SHA1 Message Date
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
e22276cef0 Tidying up of branch-predict hint macros LIKELY/UNLIKELY. Fixes
#271504.  (Florian Krohm, britzel@acm.org)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11736
2011-05-09 21:54:44 +00:00
Julian Seward
b113473e03 ppc{32,64}-linux: mark VG_MINIMAL_LONGJMP as noreturn, since it is,
and not doing so leads to compiler warnings for functions that tail
call this one, which themselves are marked "attribute noreturn".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11732
2011-05-09 09:15:28 +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
Bart Van Assche
d077061870 Linux/syswrap: add support for USBDEVFS_RESET (patch contributed by Brad Hards <bradh@frogmouth.net>).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11702
2011-04-18 10:37:56 +00:00
Julian Seward
e5a3e4f014 Add an alternative implementation of VG_MINIMAL_{SET,LONG}JMP
for ppc32-linux, that works for gcc >= 4.4.  Related to #259977.
(modified version of patch from Maynard Johnson <maynardj@us.ibm.com>)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11689
2011-04-11 21:26:27 +00:00
Julian Seward
c2120cadde Add an alternative implementation of VG_MINIMAL_{SET,LONG}JMP
for ppc32-linux, that works for gcc >= 4.4.  Related to #259977.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11688
2011-04-11 18:36:34 +00:00
Julian Seward
b3827d6c33 Create new module m_libcsetjmp, which wraps up uses of
__builtin_setjmp and __builtin_longjmp so that they can be selectively
replaced, on a platform by platform basis.  Does not change any
functionality.  Related to #259977.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11687
2011-04-11 16:17:51 +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
a17e55e5c2 Definitions relating to ptrace: replace bogus x86 versions with
arm specific versions.  Partial fix for #269079.
(Ulrich Weigand, uweigand@de.ibm.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11663
2011-03-24 11:33:00 +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
62134f346f Back out r11568 (Add a new constructor for empty XArrays,
VG_(newSizedXA)) since r11571 removes the only use of the
functionality that r11568 introduces.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11573
2011-02-27 23:53:32 +00:00
Julian Seward
0c2371837b Add a new constructor for empty XArrays, VG_(newSizedXA). This is
identical to VG_(newXA) but allows passing in a size hint.  In the
case where the likely final size of the XArray is known at creation
time, this allows avoiding the repeated (implicit) resizing and
copying of the array as elements are added, which can save a vast
amount of dynamic memory allocation turnover.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11568
2011-02-23 13:22:24 +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
dfb2ce8d2e Define VG_CLREQ_SZB correctly on ARM, so Cachegrind and Callgrind
don't assert in their regtests on ARM.  (Value is the same in both
ARM and Thumb mode, fortunately.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11432
2010-10-12 10:13:17 +00:00
Julian Seward
1a7379bf89 Enable support for sys_ppoll on arm-linux (Rodrigo Belem, rodrigo.belem@openbossa.org).
See #253636.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11428
2010-10-11 19:09:53 +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
78699f56cb Define VKI_SHMLBA on Darwin, so as to un-break build breakage caused by
r11399.  See #222545.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11405
2010-10-07 09:53:02 +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
Julian Seward
878207ebb9 Define VKI_SHMLBA for all supported Linux targets, thereby unbreaking
the breakage created by r11399.  Part of #222545.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11400
2010-10-06 15:55:59 +00:00
Julian Seward
566a25cf7e Make client sys_shmat work properly on arm-linux by taking into
account rounding requirements to SHMLBA.  Modified version of a patch
by Kirill Batuzov, batuzovk@ispras.ru.  This fixes the main bug in
#222545.  Temporarily breaks the build on all other platforms though.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11399
2010-10-06 15:24:39 +00:00
Julian Seward
19bc251432 arm-linux: determine whether the host supports Neon by looking at our
AUXV at startup, rather than by trying to execute a Neon instruction
and seeing whether it SIGILLs.  Apparently the latter is not a
reliable way to ascertain the presence of usable Neon support.  Fixes
#249775.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11347
2010-09-09 07:25:58 +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
22ddb6a319 Made declaration and definition of VG_(thread_get_stack_size)(ThreadId)
consistent.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11325
2010-09-02 14:41:05 +00:00
Bart Van Assche
0bf86ce7b9 Added functions for querying the properties of the alternate stack.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11324
2010-09-02 14:38:38 +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
Tom Hughes
3d13995189 Add support for F_DUPFD_CLOEXEC. Fixes #238696.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11316
2010-09-02 08:23:35 +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
ad584ebb64 Merge from branches/THUMB: m_machine changes needed for Thumb support:
* track guest_R15 -> guest_R15T renaming
* change min instruction size to 2
* tidy up VG_(get_IP) etc functions a bit
* add hwcaps detection code for ARM



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11283
2010-08-22 12:21:14 +00:00
Julian Seward
65e5f2fd0a Merge from branches/THUMB: add support for sys_pselect6, sys_pipe2,
sys_inotify_init1 on arm-linux.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11280
2010-08-22 12:08:59 +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
Nicholas Nethercote
6195f17db1 Replace the handful of uses of Vg_ExtraDebugMsg and VG_(emsg) with
Vg_DebugMsg and VG_(dmsg).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11210
2010-07-06 04:21:47 +00:00
Nicholas Nethercote
11f94ef626 Make error messages at start-up more consistent. Every line of such
messages now begin with "valgrind: ", and they're more often printed before
the preamble.  This required introducing a new message kind, Vg_FailMsg, and
functions VG_(fmsg) and VG_(fmsg_bad_option), and removing
VG_(err_bad_option).

Where we used to have horrible output like this:

    [ocean:~/grind/ws2] vg5 --tool=massif --threshold=101 date
    ==31877== Massif, a heap profiler
    ==31877== Copyright (C) 2003-2010, and GNU GPL'd, by Nicholas Nethercote
    ==31877== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info
    ==31877== Command: date
    ==31877== 
    ==31877== --threshold must be between 0.0 and 100.0
    valgrind: Bad option '--threshold'; aborting.
    valgrind: Use --help for more information.

We now have nice output like this:

    [ocean:~/grind/ws2] vg2 --tool=massif --threshold=101 date
    valgrind: Bad option: --threshold=101
    valgrind: --threshold must be between 0.0 and 100.0
    valgrind: Use --help for more information or consult the user manual.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11209
2010-07-06 04:05:23 +00:00
Nicholas Nethercote
ddc229eb09 Add --pages-as-heap option to Massif. Bug 203256.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11200
2010-07-01 02:35:03 +00:00
Nicholas Nethercote
6fd0eb7b07 Merged the MACOSX106 branch to the trunk. Merge command:
svn merge -r11143:HEAD svn://svn.valgrind.org/valgrind/branches/MACOSX106

There were some easy-to-resolve conflicts.

Then I had to fix up coregrind/link_tool_exe*.in -- those files had been
added independently on both the trunk and the branch, AFAICT.  I just
overwrote the trunk versions with the branch versions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11194
2010-07-01 00:20:20 +00:00
Bart Van Assche
f938bef38f Reimplemented the _VKI_IOC_TYPECHECK() macro such that it doesn't trigger a
compiler warning on PPC when it shouldn't.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11180
2010-06-15 14:55:28 +00:00
Bart Van Assche
45037a25dc Fixed compiler warnings about casting from const char * to char *.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11176
2010-06-14 18:12:56 +00:00
Tom Hughes
ef5b3e48b6 Add support for some EVIO ioctls. These are a bit abnormal because
the length part of the ioctl is not fixed so they are essentially
families of ioctls.

Based on patch from Peter Korsgaard. Fixes #235642.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11124
2010-05-07 15:32:04 +00:00
Julian Seward
d4a18f87cc Add a method to get the contents of an XArray so we can index in
it really fast, or iterate over it.  This is dangerous and breaks
the nice abstraction (sigh).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11122
2010-05-05 09:23:41 +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
cee53c896b Fix stupid bug in VG_(bzero_inline), as spotted by Bart.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11094
2010-03-15 09:03:25 +00:00