Julian Seward [Fri, 12 Feb 2010 12:12:39 +0000 (12:12 +0000)]
Try to find the PDB file for a given PE file by the totally kludgey
method of doing "strings file.dll | egrep '\.pdb|\.PDB'".
Distantly derived from a patch by leiz@ucla.edu. Fixes #222902,
although I still would prefer to do this the proper way, by parsing
the PE file properly.
Julian Seward [Sat, 30 Jan 2010 13:40:27 +0000 (13:40 +0000)]
The client request VG_USERREQ__LOAD_PDB_DEBUGINFO that we get from
Wine as a notification to read PDB/PE debug info, contains a parameter
'reloc' whose purpose is unknown, and which is unused. Rename it
accordingly, to 'unknown_purpose__reloc'. (a non-functional change)
Julian Seward [Fri, 29 Jan 2010 22:37:02 +0000 (22:37 +0000)]
PE/PDB handling: allow the PDB (the debuginfo file) to be up to 1
minute older than the PE (the .exe/.dll it describes) even though this
doesn't seem particularly safe. Partially fixes #190675.
(patch from Dan Kegel)
Julian Seward [Thu, 28 Jan 2010 15:23:54 +0000 (15:23 +0000)]
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.
Julian Seward [Wed, 27 Jan 2010 10:28:00 +0000 (10:28 +0000)]
Fix handling of mprotect so as to be more consistent with the handling
of mmap. Fixes #205541 and its dup #210268. The fix is simple enough
but the analysis is a bit complex, as detailed in comments.
Julian Seward [Fri, 15 Jan 2010 10:57:57 +0000 (10:57 +0000)]
Add command line flag --vex-guest-chase-cond=no|yes [no] to control
whether front ends should speculatively chase through conditional
branches. Disabled by default.
Julian Seward [Mon, 11 Jan 2010 13:02:19 +0000 (13:02 +0000)]
Apparently the dynamic linker on ARM-Linux has soname "ld-linux.so.3"
rather than "ld-linux.so.2". No, don't ask me why. Anyway, on
Helgrind, don't instrument code in ld-linux.so.3. This makes Helgrind
pretty much usable on ARM-Linux.
Julian Seward [Wed, 6 Jan 2010 11:08:18 +0000 (11:08 +0000)]
arm-linux: remove wrappers for __NR_ipc, __NR_mmap, __NR_sigsuspend
and __NR_sigaction, which all did I_die_here and therefore can never
have been used. I think they were here as a result of this file being
derived from the x86-linux version, and that arm-linux uses more
modern equivalents (mmap2, rt_sig*, and the broken-out versions of
ipc).
Julian Seward [Sun, 3 Jan 2010 21:24:09 +0000 (21:24 +0000)]
Make sure the Memcheck tests are built on arm-linux using hardware
floating point, since the softfloat results are way different from the
hardware one (not to mention, V reports lots of accesses-below-the-SP
in the softfloat helper functions.)
Julian Seward [Sat, 2 Jan 2010 10:41:46 +0000 (10:41 +0000)]
Redo r10971 ("Made sure that C++ compilers do not complain about the
_VKI_IOC_TYPECHECK() macro") in a way which is easier to understand.
Also, add it for arm-linux.
Julian Seward [Fri, 1 Jan 2010 20:56:13 +0000 (20:56 +0000)]
initUnwindContext: put back into the loop, some initialisations for
ARM which were originally in the loop but inadvertantly got lifted out
during recent merging. This appears to make stack unwinding work
again on ARM-Linux.
Julian Seward [Fri, 1 Jan 2010 18:46:41 +0000 (18:46 +0000)]
Make the Dwarf3 CFI stack unwinding machinery work on arm-linux
too. This is a first step towards making not be completely
x86/amd64-linux specific, and so replaces some x86/amd64-specific
stuff with more general constructions:
* structure 'DiCfSI', into which the info is summarised, has been
made target-specific (ugh), since the sets of registers to be
unwound differ on different targets.
* enum CfiReg and the CFIC_ constants have been expanded
accordingly, to handle both arm and x86/amd64 registers.
The abbreviation "IA" (Intel Architecture) has been used in a
few places where the x86 and amd64 definitions are shared.
* the CFI reader/summariser in readdwarf.c has been expanded &
generalised appropriately.
* the DiCfSI evaluator in debuginfo.c, VG_(use_CFI_info), has
also been generalised appropriately.
The main change is that instead of passing around triples
of (IP, SP, BP) values, a new structure 'D3UnwindRegs' is
passed around instead. This is defined differently for IA and
ARM and succeeds in hiding at least some of the differences
where we don't care about them.
Note also, D3UnwindRegs duplicates, in purpose and structure,
structure 'RegSummary' in priv_d3basics.h. This will be tidied
up in due course.
This commit almost certainly breaks stack unwinding on amd64-linux.
Julian Seward [Fri, 1 Jan 2010 18:30:59 +0000 (18:30 +0000)]
Don't use -Wdeclaration-after-statement. We long since abandoned any
pretense of being buildable with gcc prior to 3.0, hence there's no
point in having this flag.
Julian Seward [Fri, 1 Jan 2010 11:59:33 +0000 (11:59 +0000)]
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.
Bart Van Assche [Tue, 29 Dec 2009 14:11:38 +0000 (14:11 +0000)]
Changes:
- Made sure that C++ compilers do not complain about the header files
include/pub_tool_libcassert.h and include/pub_tool_basics.h.
- Added the source file none/tests/valgrind_cpp_test.cpp. This source file
is compiled together with the regression tests in order to verify that
Valgrind's public header files compile cleanly with a C++ compiler.
These modifications are based on a patch provided by Konstantin Serebryany.
Callgrind: fix bug 217849: Switch to running thread in CLG_(post_signal)
If instrumentation is switched off on multithreaded code,
multiple signals in a row handled by different threads could
confuse callgrind.
Callgrind assumed that in post_signal, it has the correct understanding
of the currently running thread. This is not always correct.
Really switch to running thread.
Tom Hughes [Thu, 3 Dec 2009 09:50:32 +0000 (09:50 +0000)]
Cope with prelink splitting the bss section of an ELF file into separate
dynbss and bss sections by merging them back together again.
This means that (a) we will find variables in the bss and (b) we won't
assert when there is a debuginfo file present where the bss is still
in one piece.
Tom Hughes [Wed, 2 Dec 2009 16:19:12 +0000 (16:19 +0000)]
It seems whoever wrote the preadv and pwritev system calls in the
kernel decided it would be fun to make them always take the low word
of the offset argument before the high word regardless of the
endianism of the system... Consistency - they've heard of it...
Tom Hughes [Wed, 25 Nov 2009 11:29:14 +0000 (11:29 +0000)]
Clean up support for sync_file_range system call and add second version used
by ppc platforms based on patch from Dodji Seketeli. Part fix for #215973.
Tom Hughes [Wed, 25 Nov 2009 11:24:00 +0000 (11:24 +0000)]
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.
Tom Hughes [Thu, 12 Nov 2009 13:28:34 +0000 (13:28 +0000)]
Various improvements to DWARF handling to cope with changes in recent
versions of gcc as shipped with Fedora 12. Specific changes include:
- Vastly increase the number of opcodes we understand how to
evaluate when processing a location expression.
- Process frame unwind data from the debug_frame ELF section as
well as the eh_frame section.
- Handle version 3 CIEs in frame unwind data.
- Handle the compact form of DW_AT_data_member_location which just
gives a constant offset from the start of it's base type instead
of a full location expression.
Based on patches from Jakub Jelinek on bugs #210479 and #210566.
Julian Seward [Thu, 5 Nov 2009 08:55:13 +0000 (08:55 +0000)]
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.