3838 Commits

Author SHA1 Message Date
Florian Krohm
0d689e773b Include README_DEVELOPERS for the GDB server in the tarball.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12217
2011-10-23 13:51:34 +00:00
Julian Seward
0d7caa744f Get a bunch more copyright dates in the right format, 20xx-2011,
so the auto-update script will handle them correctly in future.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12207
2011-10-23 07:49:30 +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
Julian Seward
ba88dbd353 Make vgdb.c work on Android, so that the GDB server as a whole
will work on Android.  Fixes #283600.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12204
2011-10-22 20:38:08 +00:00
Julian Seward
a07f759681 Addition of v.info scheduler monitor command
Monitor command useful for debugging/investigation of Valgrind unwinder and/or
gdbserver/gdb stack trace.

The Valgrind unwinder has some limitations compared to the GDB unwinder.
(see e.g. 278972).

With this monitor command, it is easy to see if the Valgrind unwinder
produces something different than the GDB unwinder.

Fixes #279212.  (Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12203
2011-10-22 20:23:30 +00:00
Bart Van Assche
ae452d5320 Fix a compiler warning introduced in r12188
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12192
2011-10-22 09:42:05 +00:00
Bart Van Assche
72cd30c206 XML output: escape XML-metacharacters in executable path and arguments. This is a modified version of the patch submitted by Evgeniy Stepanov <eugeni.stepanov@gmail.com>. See also #284621.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12188
2011-10-22 08:24:32 +00:00
Julian Seward
19f702f49f ML_(ppSym): minor improvement in debug printing for DiSyms.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12185
2011-10-21 05:00:37 +00:00
Julian Seward
9bb0938218 Debug printing only: when printing SB translation header lines,
print the object and SVMA too, so as to make it easy to find the
relevant bit of code by objdump -d of the object, even if the
function name is unknown.  Also re-order some of the fields.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12184
2011-10-21 04:59:56 +00:00
Julian Seward
58d0ead76e Enable sys_epoll_pwait on arm-linux. #283427. Derived from
larger patch by John Reiser (jreiser@bitwagon.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12177
2011-10-20 13:00:32 +00:00
Julian Seward
1007d8b2c9 ppc64-linux: handle sys_setresuid and sys_setresgid. #273640.
(Jan Stancek, jan.stancek@gmail.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12175
2011-10-20 10:44:34 +00:00
Julian Seward
bd26301df3 Fix a compile warning on {ppc32,ppc64}-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12174
2011-10-20 10:41:37 +00:00
Julian Seward
dcdaa88f60 Avoid potential overflow in range check. #273431.
(Alexandre Duret-Lutz, adl@gnu.org)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12173
2011-10-20 08:09:39 +00:00
Josef Weidendorfer
d08c246e3f Fix callgrind part of bug 280757.
For this, we make VG_(tmpdir) available to tools.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12163
2011-10-17 18:12:48 +00:00
Bart Van Assche
7680fced62 Use proper automake variable (patch from Philippe Waroquiers - see also #273465)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12162
2011-10-15 07:52:46 +00:00
Bart Van Assche
337b3b5525 Emit <state>RUNNING</state> earlier
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12136
2011-10-11 18:50:14 +00:00
Bart Van Assche
99066365d5 Add format specifier %ps: only escape XML-metacharacters for --xml=yes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12135
2011-10-11 18:49:35 +00:00
Bart Van Assche
71a513f01a Format functions: change format specifier %t into %pS. Remove the _no_f_c formatting function variants.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12108
2011-10-06 19:08:37 +00:00
Florian Krohm
85f41f4c8f Declare _exit as "noreturn". This will avoid a GCC warning.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12106
2011-10-05 14:51:55 +00:00
Tom Hughes
d991dfe727 More fixes for unaligned accesses in the debuginfo code. BZ#282527.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12102
2011-10-05 08:48:07 +00:00
Tom Hughes
64d14c247b Fix another read_UInt that should be read_Addr.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12089
2011-10-03 17:01:57 +00:00
Florian Krohm
080f2bb992 Update names of vgdb pipes in documentation. Followup to r12071.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12088
2011-10-03 16:55:26 +00:00
Tom Hughes
acc83cb540 Add read_Addr and use it so that we work on systems where an address
is bigger that an int.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12084
2011-10-02 12:12:38 +00:00
Tom Hughes
8ecff4c133 Avoid using direct access to read multi-byte values from DWARF files
and use read_Type routines instead as they work rather better on strict
aligned (or semi-strict a la ARM) machines. Fixes #282527.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12083
2011-10-02 10:49:35 +00:00
Tom Hughes
c5b8629171 Use read_UInt to get the CRC as it may not be aligned. Fixes #283154.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12082
2011-10-02 10:22:08 +00:00
Tom Hughes
8437facdd1 Move read_<type> routines from readdwarf.c to be module level
routines in misc.c so that other parts of the debuginfo module
can access them.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12081
2011-10-02 10:20:12 +00:00
Julian Seward
5806ea6327 * (marginally) fix debug printing for new 10.7 syscalls
* also, remove SfMayBlock annotations for those that obviously won't


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12075
2011-09-30 17:51:21 +00:00
Julian Seward
96c9deba29 Fix a couple of buffer overruns. n-i-bz.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12074
2011-09-30 07:11:13 +00:00
Julian Seward
9272b8d947 Make wqthread_hijack not assert on x86-darwin. Same hack as
for the 64-bit case.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12073
2011-09-30 07:05:17 +00:00
Florian Krohm
f8b208153d Change the name of the pipes for vgdb by adding username and hostname.
Those are obtained by looking at some commonly defined environment
variables.
That should help with problems where /tmp is shared or process IDs get
recycled. We had some intermittent nightly build issues because of that.
Partial fix for bugzilla #280757.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12071
2011-09-29 21:20:49 +00:00
Julian Seward
fc16ea6412 Make {amd64,x86}-darwin use the direct implementations of
VG_MINIMAL_SETJMP and VG_MINIMAL_LONGJMP introduced in r12067.

With this commit, it should be possible to build a working 64 bit
Valgrind using the default gcc as supplied with Xcode 4.1 on OSX 10.7.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12070
2011-09-29 18:29:41 +00:00
Julian Seward
f77496fcf0 Be a bit more careful about the return type for VG_MINIMAL_SETJMP,
both the home-grown versions and the versions that feed through to
__builtin_setjmp.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12068
2011-09-29 17:34:17 +00:00
Julian Seward
fee9cdc61e x86-linux, amd64-linux: Implement VG_MINIMAL_SETJMP and
VG_MINIMAL_LONGJMP directly, rather than using __builtin_setjmp
and __builtin_longjmp, since clang-2.9 miscompiles the latter
(by completely ignoring it.)

Also, add comment about the return type for VG_MINIMAL_SETJMP.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12067
2011-09-29 17:33:58 +00:00
Florian Krohm
ab466bd7b7 Fix a regression (none/tests/cmdline[12]) which was introduced
by r12063. 
VG_(clo_vgdb_prefix) was used before it was initialized.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12064
2011-09-29 14:26:38 +00:00
Florian Krohm
47c681afb8 Remove hardwired /tmp directory in vgdb. Honour VG_TMPDIR
and TMPDIR which was introduced when fixing bugzilla #267020.
Factor out VG_(tmpdir). New function VG_(vgdb_path_prefix).
Partially fixes bugzilla #280757. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12063
2011-09-29 03:03:45 +00:00
Julian Seward
57b66d4b7d Add support for hardware-specific ioctl wrappers on Android,
starting with those required for the graphics hardware on 
Nexus S.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12060
2011-09-27 11:40:24 +00:00
Julian Seward
cea6601bf2 Android: add wrappers for ashmem and binder ioctls. From the AOSP
port of Valgrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12059
2011-09-27 10:26:52 +00:00
Julian Seward
941df4bd6c Un-break debuginfo image finding on non-Android Linuxes following
r12057, duh.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12058
2011-09-27 10:24:52 +00:00
Julian Seward
e843da3851 Add a facility for ad-hoc location of debuginfo files on Android.
All other platforms are unaffected.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12057
2011-09-27 09:26:39 +00:00
Julian Seward
b5f30896db ML_(read_elf_debug_info): (no functional change, I hope): fix up
confusing control flow, by separating the logic for "is there a
debuginfo file to be found?" from that of "if a debuginfo file was
found, let's record certain facts (section offsets etc) about it."

This makes it possible to add arbitrary other schemes for finding
debuginfo files without further complicating the existing control flow.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12056
2011-09-27 08:57:41 +00:00
Julian Seward
bda076043c Android only: don't ignore zero-sized symbols, since some of them
are ones that m_redir really needs to see.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12055
2011-09-27 08:06:14 +00:00
Julian Seward
f2f5329313 Heap profiler: reduce threshold at which a new profile is shown for
an arena from 10% to 5%.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12052
2011-09-26 20:17:41 +00:00
Julian Seward
efc3e2cef5 Pretty up the debugging hack that allows printing of stack traces
for selected syscalls.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12051
2011-09-26 20:16:15 +00:00
Julian Seward
4725b367ab Re-enable the use of loctab (line number table) trimming, for a 5% to
10% reduction in debuginfo storage requirements for large applications
on 32 bit platforms.  This code had been present since the MacOSX port
was merged but had been disabled.  Remove equivalent code for
shrinking the symbol tables since they are much (4 x) smaller than the
line number tables, trimming them is hardly worth the effort.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12050
2011-09-26 20:15:07 +00:00
Julian Seward
99602cf81a run_a_thread_NORETURN: add trashed-register annotations for the magic
bits of assembly which finally cause the thread to exit.  How this
ever worked before, on any platform, beats me.  The lack was causing
some Android builds to segfault at thread exit.  Only the s390 version
was correct.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12049
2011-09-26 17:50:46 +00:00
Julian Seward
34a86e3b10 Print a slightly less useless failure message if VG_(mkstemp) fails to
create a temp file, as often happens on Android.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12048
2011-09-26 16:46:04 +00:00
Julian Seward
a69c68d8d5 m_mallocfree.c: generalise 'reclaimSuperBlock' to also reclaim
splittable superblocks.  Bug #282105.

(Philippe Waroquiers, philippe.waroquiers@skynet.be)

A previous patch (bug 250101) introduced the concept of reclaimable
superblock: a superblock that cannot be splitted in smaller blocks
and that can be munmapped.

This patch generalises the reclaimable concept : all superblocks are
now reclaimable. To reduce fragmentation, big superblocks are still
kept unsplittable.

The patch has 4 aspects:
1 The previous concept of 'reclaimable superblock' is renamed
  'unsplittable superblock' (this is a mechanical change).
2 Ensure that splittable blocks can be reclaimed :
  After each free, if the free results in a merged block which
  completely covers the superblock, then the superblock can be reclaimed.
3 If a superblock is reclaimed and there exists some translations 
  for this superblock then discard the translations.
  Note : I did not understand the comment speaking about
  circular dependency. Just calling VG_(discard_translations) seems
  to cause no problem. As m_transtab.c does not allocate client memory,
  I believe no circular (dynamic) dependency can be done.
4 Activate 'unsplittable superblock' for all arenas.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12047
2011-09-26 11:28:20 +00:00
Florian Krohm
166c3bcd27 Remove code duplication from the dispatchers. Keep the core loop
in common.
To accomplish that without penalizing the non-profiling dispatcher
we do the stats gathering *after* the jitted code returns to the
dispatcher. For that to work properly, we need to stash away the
instruction adddress before entering the jitted code so we can use
it later. (See also VEX r2208).

Two other tweaks are included here:
(1) For the non-profiling dispatcher it is not necessary to update
    the LR in each iteration. Quite obviously the jitted code cannot
    modify the LR in its iteration because it needs it at the very end
    when it returns. So we move this step out of the core loop.
(2) Move loading the address of VG_(tt_fast) past testing for a changed
    guest state pointer. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12044
2011-09-25 00:15:54 +00:00
Julian Seward
8885c4e740 Add initial support for Mac OS X 10.7 (Lion). Tracked by bug #275168.
* configure.in support

* new supp file darwin11.supp

* comment out many intercepts in mc_replace_strmem.c and
  vg_replace_malloc.c that are apparently unnecessary for Darwin

* add minimal handling for the following new syscalls and mach traps:
    mach_port_set_context
    task_get_exception_ports
    getaudit_addr
    psynch_mutexwait
    psynch_mutexdrop
    psynch_cvbroad
    psynch_cvsignal
    psynch_cvwait
    psynch_rw_rdlock
    psynch_rw_wrlock
    psynch_rw_unlock
    psynch_cvclrprepost

* wqthread_hijack on amd64-darwin: deal with
  tst->os_state.pthread having an apparently different offset,
  which caused an assertion failure

* m_debuginfo: for 32 bit processes on Lion, use the DebugInfoFSM
  cleanup added in r12041/12042 to handle apparently new dyld
  behaviour, which is to map text areas r-- first and only
  vm_protect them later to r-x.



The following cleanups remain to be done

* remove apparently pointless, commented out wrapper macro
  invokations in mc_replace_strmem.c, eg

  //MEMMOVE(VG_Z_DYLD,        memmove)

  (or determine that they are still necessary, and uncomment)


* ditto in vg_replace_malloc.c, plus general VGO_darwin cleanups
  there


* write proper syscall wrappers for
    mach_port_set_context
    task_get_exception_ports
    getaudit_addr
    psynch_mutexwait
    psynch_mutexdrop
    psynch_cvbroad
    psynch_cvsignal
    psynch_cvwait
    psynch_rw_rdlock
    psynch_rw_wrlock
    psynch_rw_unlock
    psynch_cvclrprepost
  These are currently just no-ops and may be causing Memcheck to
  report false undef-value errors


* figure out why it doesn't work properly unless built with gcc-4.2 on
  Lion.

  gcc-4.2 is the "normal" gcc (i686-apple-darwin11-gcc-4.2.1).  Plain
  gcc is the hybrid gcc-front-end clang-back-end thing
  (i686-apple-darwin11-llvm-gcc-4.2).  Whereas on Snow Leopard, plain
  gcc is the normal gcc.

  The symptoms of the failure are that wqthread_hijack in
  syswrap-amd64-linux.c hits this /*NOTREACHED*/ vg_assert(0); right
  at the end (you need a pretty complex threaded app to trigger this),
  which makes me think that either ML_(wqthread_continue_NORETURN) or
  call_on_new_stack_0_1 do return, which they are not expected to.


* figure out if some of the uninitialised value errors reported in
  system libraries on are caused by Memcheck being confused by LLVM
  generated code, as per bug #242137



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12043
2011-09-21 08:43:08 +00:00
Julian Seward
ccaa4e370a Un-break Darwin build following r12041 (creation of struct _DebugInfoFSM)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12042
2011-09-20 22:36:26 +00:00