Commit Graph

275 Commits

Author SHA1 Message Date
Julian Seward
f83e5835b1 read_dwarf2_lineblock: debug printing fix (no functional change)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11733
2011-05-09 09:19:32 +00:00
Julian Seward
1ccdd881a6 calling format_message: when passing frameNo == -1, also pass
tid == VG_INVALID_THREADID rather than an uninitialised ThreadId.
Also in format_message, improve precondition assertions for
frameNo and tid.

There's no error in the current code since if frameNo == -1 then
tid is unused, but it caused IBM's BEAM checker to complain.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11723
2011-05-04 09:06:17 +00:00
Julian Seward
b1a118436a Make reading of line number info from LLVM-2.9-generated Dwarf3 work.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11705
2011-04-21 08:55:51 +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
adb0e3b18d Remove a bunch more warnings generated by gcc-4.6 about dead
assignments ("[-Wunused-but-set-variable]"), on ppc32-linux and
ppc64-linux.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11674
2011-03-28 20:33:52 +00:00
Julian Seward
9c6d0dc9c9 Fix up most but not all warnings generated by gcc-4.6 about
dead assignments ("[-Wunused-but-set-variable]").



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11673
2011-03-28 16:26:42 +00:00
Bart Van Assche
47fa81b4bf Process PDB files with a path that contains spaces properly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11617
2011-03-10 12:49:50 +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
Julian Seward
afa6fa71cb Handle Dwarf3 types created by GNAT. Fixes #255130.
(Philippe Waroquiers <philippe.waroquiers@skynet.be>)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11517
2011-02-01 23:10:14 +00:00
Julian Seward
401f70d784 Minor improvements to PDB reading:
* better progress messages, to make it clear that reading of a
  PDB is finished, and how much stuff was read from it

* don't mmap PDB files to read them -- instead use VG_(read).
  This is because CIFS filesystem mounting only works reliably on
  Linux when mounted with option '-o directio', and that
  disallows mmap-ing files.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11482
2010-12-06 11:11:29 +00:00
Tom Hughes
77171c6bfb Avoid a double free when a binary has a build-id and no debuglink section.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11458
2010-10-19 13:12:59 +00:00
Tom Hughes
8a3cde403f Add support for DW_ATE_UTF from DWARF4 which is needed for char16_t
support in C++0X.

Patch from Christian Borntraeger on bug #254550.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11450
2010-10-18 14:57:58 +00:00
Tom Hughes
9900b430c5 Don't look for build-id notes if NT_GNU_BUILD_ID is not defined.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11449
2010-10-18 13:04:13 +00:00
Tom Hughes
c8aedaf422 Add support for using build-id to find debugging information as
some distributions are starting to drop the old debuglink support
now. Fixes #254257.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11448
2010-10-18 12:38:22 +00:00
Julian Seward
1375448f10 Make the --prefix-to-strip=... command-line option added in r11312
behave more like the original proposal in #245535.  This makes it
more flexible and general.  Also rename it.

* new name is --fullpath-after=

* allow multiple instances of --fullpath-after=

* don't require the specified strings to be prefixes, only substrings

But retain the elegant backwards-compatibility trick in Bart's r11312
commit: if --fullpath-after= is not specified at all, then behave
exactly as before.

Fixes #245535.  A mixture of patches from Bart Van Assche
(bart.vanassche@gmail.com), Alexander Potapenko (glider@google.com),
and me (integration and documentation).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11430
2010-10-12 00:44:05 +00:00
Julian Seward
2569c4fc94 Remove some fluff detected by llvm-2.8 (clang):
- "*(int *)0 = " is apparently ignored by LLVM for who-knows-why
  reason.  Cast the zero to a volatile int * instead.

- remove an unused function that gcc failed to mention was unused
  (why?  because it was marked __attribute__((noreturn)) ?)

As an aside, clang/llvm-2.8 seemed to be able to successfully
compile Valgrind.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11429
2010-10-11 19:15:33 +00:00
Julian Seward
18503c8e64 Dwarf3 reader: handle Dwarf3 created by gcc-4.5.1. In other words,
work around the all-new-buggy-Dwarf3 created by gcc-4.5.1.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11418
2010-10-08 23:57:25 +00:00
Julian Seward
d1bad49f00 Only use VKI_O_LARGEFILE on platforms where it exists. This
unbreaks the build breakage on Darwin introduced in r11397, which
was a fix for #234064.  The breakage was subsequently reported
in #253420 and #253452, which this commit fixes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11406
2010-10-07 09:56:19 +00:00
Julian Seward
c72198e061 When opening an mmaped file to see if it's an ELF file that we should
read debuginfo from, use VKI_O_LARGEFILE, so as to ensure the open
succeeds for large files on 32-bit systems.  Fixes #234064.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11397
2010-10-06 11:38:01 +00:00
Julian Seward
f5e67f801d Make readdwarf.c big endianess safe to enable unwinding on big endian
systems.  (Christian Borntraeger, borntraeger@de.ibm.com).  Fixes
#248893.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11391
2010-09-30 15:11:01 +00:00
Julian Seward
0bb6f49531 On arm-linux, add r7 to the set of registers that the CFI unwinder
knows how to unwind.  This is important when unwinding Thumb code
the CFA is often stated as being at some offset from r7.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11377
2010-09-23 22:05:59 +00:00
Julian Seward
4953c95227 DW_CFA_advance_loc{,1,2,4} fail to multiply the delta by
code_alignment_factor, thereby assuming it is 1.  This happens to be
OK on amd64-linux and s390x-linux because it really is 1, but on
arm-linux it is 2, and hence the boundaries between code-unwind areas
are simply wrong after any of DW_CFA_advance_loc{,1,2,4} are
processed.  This patch provides the obvious fix.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11376
2010-09-23 13:24:48 +00:00
Bart Van Assche
35eece7dd5 Added command-line option --prefix-to-strip=... Closes #245535.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11312
2010-08-31 15:18:32 +00:00
Julian Seward
4bfb6b06e6 pdb_ds_read: if the presented size is implausibly huge (> 512MB),
ignore it on the assumption that the .pdb is corrupt, rather than
running the system out of memory by trying to allocate a chunk of that
size.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11226
2010-07-22 22:36:43 +00:00
Julian Seward
9eeffc3968 Put quotes around the argument to /usr/bin/dsymutil, so it doesn't
screw up on filenames with spaces.  Fixes (part of) #205093.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11219
2010-07-21 16:00:08 +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
Tom Hughes
25b8be58ad Add some basic DWARF4 support. Based on patch from Jakub Jelinek
but with support for VLIW architectures with multiple opcodes per
instruction removed. Fixes #233595.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11106
2010-04-28 08:09:30 +00:00
Julian Seward
448fa2462a search_all_symtabs: when mapping addresses to text symbols, consider
any symbol in the r-x mapped segment to be a valid candidate.  This
relaxes the filtering criterion slightly, makes it consistent with
other is-it-text? checks.  Some addresses which before didn't get
mapped to anything are now correctly mapped to "vtable for Foo"
symbols.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11104
2010-04-12 20:56:56 +00:00
Julian Seward
8177e0722f Inline most functions in VG_(use_CF_info). May or may not give a
3% performance increase for Helgrind in default (detailed-history)
mode.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11093
2010-03-14 17:19:02 +00:00
Julian Seward
811fdfeae2 Guard new debug print statement in r11045 correctly (at all!)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11047
2010-02-15 12:00:28 +00:00
Julian Seward
22f52b5836 Make -v messages w.r.t. finding of auxiliary debuginfo files less confusing.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11045
2010-02-15 10:05:40 +00:00
Julian Seward
be103bbcfc Reduce verbosity of the PDB reader a bit. Original verbosity is still
available using "-v".



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11040
2010-02-12 12:19:36 +00:00
Julian Seward
5686e8d89d 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11039
2010-02-12 12:12:39 +00:00
Julian Seward
66e628a398 Fix bogus comparisons of PDB vs PE timestamps, so as to avoid
signed vs unsigned confusion.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11038
2010-02-10 13:37:37 +00:00
Julian Seward
5df7c91476 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)




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11036
2010-01-30 13:40:27 +00:00
Julian Seward
34016f514a Fix up obviously-bogus FPO biasing a bit. Not that I have any idea if
this helps at all.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11035
2010-01-30 13:36:37 +00:00
Julian Seward
09e143240d Make the FPO reader much more robust against apparently nonsensical
FPO tables.  Also, improve debug printing for FPO reading.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11034
2010-01-30 13:07:08 +00:00
Julian Seward
69944232f8 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)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11033
2010-01-29 22:37:02 +00:00
Julian Seward
59ee7ebc94 Fix up debug printing for the PDB reader, so it can be properly
controlled from the command line.  Recommended flags are

-v --trace-symtab=yes "--trace-symtab-patt=*nameofinteresting.exe" 

Also print entry/exit information for DEBUG_SnarfCodeView and
DEBUG_SnarfLinetab.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11030
2010-01-26 13:26:41 +00:00
Tom Hughes
e877852408 DW_OP_mod should do unsigned arithmetic. Closes #223656.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11028
2010-01-21 10:19:46 +00:00
Julian Seward
6a9a4015c7 Various minor fixups to make ppc32/64-linux work again following
recent ARM-Linux merge.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10992
2010-01-02 13:24:58 +00:00
Julian Seward
7db25d24a4 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10988
2010-01-01 20:56:13 +00:00
Julian Seward
9249a3eae7 Unbreak stack unwinding on x86-linux and amd64-linux following merge
of ARM CFI unwinding in r10986.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10987
2010-01-01 19:55:17 +00:00
Julian Seward
6bc7295264 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10986
2010-01-01 18:46:41 +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
Julian Seward
9fd891fe9a Double the size of some table to do with reading CIEs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10964
2009-12-03 14:35:15 +00:00
Tom Hughes
fd60a9f72f 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.

Patch from Jakub Jelinek, closes #217084.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10963
2009-12-03 09:50:32 +00:00
Tom Hughes
2cf9be763f Make sure isIFunc is initialised whenever we add a symbol.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10944
2009-11-16 09:07:07 +00:00
Tom Hughes
a8d9dea068 Handle the isIFunc flag when canonicalising the symbol table.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10943
2009-11-16 09:06:50 +00:00