30 Commits

Author SHA1 Message Date
Julian Seward
7f9bff9f46 Handle a couple of artefacts generated by gcc-4.4: DW_OP_reg{0..31}
and DW_OP_const1s.

--> 3_4_BRANCH




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9057
2009-01-25 23:48:31 +00:00
Tom Hughes
4ca0c5f735 Don't assume that all global variables are in the data section - we
now cope with variables in the text, data, sdata and bss sections.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9021
2009-01-22 13:40:12 +00:00
Julian Seward
335992d8fc Merge all remaining changes from branches/PTRCHECK. These are some
relatively minor extensions to m_debuginfo, a major overhaul of
m_debuginfo/readdwarf3.c to get its space usage under control, and
changes throughout the system to enable heap-use profiling.

The majority of the merged changes were committed into
branches/PTRCHECK as the following revs: 8591 8595 8598 8599 8601 and
8161.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8621
2008-09-18 18:12:50 +00:00
Bart Van Assche
8e96150945 Merged FORMATCHECK branch (r8368) to trunk.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8369
2008-07-07 06:49:24 +00:00
Julian Seward
14af4957fc Merge in the DATASYMS branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7540
2008-03-03 01:35:41 +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
Julian Seward
61b40d2d66 Handle DW_OP_plus_uconst. Possibly fixes #155091 (not yet confirmed
by reporter).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7347
2008-01-14 12:04:11 +00:00
Julian Seward
6520d8f476 Be more robust against malformed DWARF2 line number information: don't
assert when a reference is made to a filename not in the filename
table.  Fixes #150380 and #129937.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7191
2007-11-20 08:46:05 +00:00
Julian Seward
8629b74b36 Handle DW_OP_deref in DWARF3 expressions. Fixes #147285.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6793
2007-08-31 23:08:39 +00:00
Julian Seward
1907f8c209 Handle DW_CFA_def_cfa_expression; also DW_OP_mul.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6627
2007-02-28 13:03:27 +00:00
Julian Seward
142e2aedb7 Fill in a few more DWARF3 'expression' related cases.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6626
2007-02-28 01:46:30 +00:00
Julian Seward
046ec22beb Barf more elegantly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6623
2007-02-27 18:38:33 +00:00
Julian Seward
0cbff69f1c Make the leb readers 64-bit clean. That should guard against another
couple of decades of Moore's law.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6621
2007-02-27 17:43:43 +00:00
Julian Seward
9377cf0ea5 Add limited support for DWARF3 'expressions' in stack-unwind (CFI)
info (DW_CFA_def_cfa_expression, DW_CFA_expression,
DW_CFA_val_expression).  Mechanism to support all of these is in place
although only DW_CFA_val_expression is currently connected up.

This is really nasty.  The basic idea is to partially evaluate each
expression at the debuginfo-reading time by running it on a stack
machine in which each stack element is an expression tree.  If the
expression can be 'run' successfully, the tree (dag, really) remaining
at the top of the stack is massaged and put into the DiCfSI record for
that address range.  At unwind time the tree is evaluated if needed.
Such cases are in fact extremely rare and so the vast majority of
unwindings use the same mechanism as before.

As a result of all this:

* some obscure cases in glibc-2.5's libpthread.so unwind when they
  didn't before

* --debug-dump=frames produces identical output to that of readelf
  for libc-2.5.so and associated libpthread.so

* All the action centers around the new type CfiExpr, which is a
  union expression-tree type in the same style as IRExpr et al

* Many dark corners of the CFI reader have been looked at and
  (re-)validated



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6620
2007-02-27 16:52:23 +00:00
Julian Seward
9a4164c5f3 Comment-only change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6617
2007-02-25 17:13:19 +00:00
Julian Seward
b095682a89 CFI reader: make reading of 'encoded addresses' be much more in
line with the DWARF3 spec and also with binutils/readelf.c:

- Update some comments

- Get rid of kludge_then_addDiCfSI; apparently no longer needed

- Pass the SegInfo's text_bias around in the AddressDecodingInfo,
  so that ...

- read_encoded_Addr can set 'base' to the text_bias when handling
  DW_EH_PE_absptr.  This is the central change of this commit and
  appears (to me) to be what DWARF3 requires.  (The spec is less
  than clear ..)

- don't use read_encoded_Addr to read the FDE arange field since
  read_encoded_Addr's adding-on of a 'base' value is meaningless
  here - the arange is not an address, but a value saying how many
  bytes the FDE covers.  Instead just read a little-endian value of
  the right size.  This is in accordance with DWARF3 and with 
  readelf.c.  Add new function read_le_encoded_literal to make 
  this possible.

I believe this is all correct, and it's certainly much better than it
was.  But given that the DWARF3 spec isn't as formal as it should be,
it's hard to be sure.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6611
2007-02-24 23:29:31 +00:00
Julian Seward
80835689c0 Make the frame unwinder able to handle 64-bit DWARF (untested :-(
mostly by a lot of comparison of this code vs that of
binutils-2.17/binutils/dwarf.c vs the relevant specs.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6610
2007-02-23 10:10:02 +00:00
Julian Seward
f8d99e1ee3 Improve --debug-dump=frames output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6600
2007-02-16 20:11:27 +00:00
Julian Seward
c555fa5434 Correctly handle DW_CFA_def_cfa_sf (existing code fails to scale
offset by data_a_f).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6599
2007-02-16 19:20:28 +00:00
Julian Seward
6b895f8c7d Non-functional (debug printing only) change:
Implement GNU binutils 'readelf' style output for --debug-dump=lines
(fully) and --debug-dump=frames (partially).

Initial testing with --debug-dump=lines shows our DWARF2 line number
reader behaves identically to readelf for all examples I tried so far.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6597
2007-02-16 14:17:10 +00:00
Julian Seward
0dfa208588 Essentially non-functional tidyings and improvements to debuginfo
reading.  Two sets of changes:

* New flags for debugging the readers.  
  --debug-dump=syms
  --debug-dump=line
  --debug-dump=frames

  These (currently accepted but nonfunctional) are intended to
  create output in the style of (that is, identical to)
    /usr/bin/readelf --syms
    /usr/bin/readelf --debug-dump=line
    /usr/bin/readelf --debug-dump=frames
  respectively.  The plan is that flaws in these readers can then
  be easily found by diff-ing the output against that from readelf.

  Also, a new flag --trace-symtab-patt=<object filename pattern>
  which is used to limit all debuginfo-related debug info to the
  set of shared object names matching the given pattern.  This
  facilitates extracting the debuginfo details of one specific
  shared object, which is usually what is required, rather than
  having to wade through megabytes of junk from every object in
  the process.

* Propagate the avma/svma/image address-naming scheme
  (as described at the top of debuginfo.c) through large parts of
  readelf.c and readdwarf.c.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6588
2007-02-12 17:47:14 +00:00
Julian Seward
20ce1d0a81 Handle DW_CFA_undefined (produced by PathScale 2.4 on amd64-linux)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6510
2007-01-12 19:21:22 +00:00
Julian Seward
c8bb92ec69 ML_(read_callframe_info_dwarf2): deal better with CIEs with no
augmentation (has to do with read_encoded_Addr).  This "fix" is a
kludge and may be replaced in future by something cleaner.  See
extensive comment addition for the whole sorry tale.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6509
2007-01-12 19:03:19 +00:00
Julian Seward
00c15317cc Non-functional change: rename a bunch of variables and field names
that hold various kinds of addresses during debuginfo reading, so as
to make it easier to understand.  See comment at top of debuginfo.c.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6506
2007-01-11 19:42:11 +00:00
Julian Seward
172505c978 Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488
2007-01-08 06:01:59 +00:00
Julian Seward
cf7e9dbc05 CFI reader: when decoding the single (address) argument to
DW_CFA_set_loc, take into account any encoding info conveyed by the
augmentation string.  See big comment in the code.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6356
2006-11-16 12:21:52 +00:00
Julian Seward
ad67fd79fe Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954
2006-06-05 23:21:15 +00:00
Julian Seward
ddf1056a0e Properly handle external debuginfo (.gnu_debuglink) for stripped and
prelinked libraries (patch from L. David Baron).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5841
2006-04-12 10:08:05 +00:00
Julian Seward
1cebaa9c21 Fold in a patch which appeared in FC5's default valgrind build, which
causes V to ignore more DWARF3 CFA expressions on amd64 and so gets
rid of complaints from the CFA reader.  Why didn't Red Hat push this
patch upstream?  I don't know.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5838
2006-04-08 16:22:53 +00:00
Julian Seward
27b95f28a5 Cleanup/restructure m_debuginfo, as described in
coregrind/m_debuginfo/README.txt.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5823
2006-04-04 15:12:44 +00:00