]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
fix 338024 inlined functions are not shown if DW_AT_ranges is used
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 5 Aug 2014 19:34:35 +0000 (19:34 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 5 Aug 2014 19:34:35 +0000 (19:34 +0000)
Based on investigation and patch by Matthias Schwarzott.
(no small test found that reproduced the problem,
but the equivalent patch given in bug 338024 fixed the inlined stack
trace  in a big shared lib).
Would be nice however to have a small test case ...

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14236

NEWS
coregrind/m_debuginfo/readdwarf3.c

diff --git a/NEWS b/NEWS
index 01e985d3693ff58dff647d1d3ae89f853810a06b..dd814525be2f64405c300c8d8b0909adf1b1b0eb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -202,6 +202,7 @@ where XXXXXX is the bug number as listed below.
 337094  ifunc wrapper is broken on ppc64
 337285  fcntl commands F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK not supported
 337528  leak check heuristic for block prefixed by length as 64bit number
+338024  inlined functions are not shown if DW_AT_ranges is used
 n-i-bz  Fix KVM_CREATE_IRQCHIP ioctl handling
 n-i-bz  s390x: Fix memory corruption for multithreaded applications
 n-i-bz  vex arm->IR: allow PC as basereg in some LDRD cases
index 7f7f3e9dbce59a2245cdf84724455802e514398f..c5234a1e9baee36bfcdf393f3507e7351e98eb15 100644 (file)
@@ -2608,14 +2608,18 @@ static Bool parse_inl_DIE (
          Word j;
          HChar *inlfnname = get_inlFnName (inlinedfn_abstract_origin, cc, td3);
 
-         /* Why is get_range_list biasing with cc->cu_svma and 
-            not with text_debug_bias ? */
+         /* Ranges are biased for the inline info using the same logic
+            as what is used for biasing ranges for the var info, for which
+            ranges are read using cc->cu_svma (see parse_var_DIE).
+            Then text_debug_bias is added when a (non global) var
+            is recorded (see just before the call to ML_(addVar)) */
          ranges = get_range_list( cc, td3,
                                   rangeoff, cc->cu_svma );
          for (j = 0; j < VG_(sizeXA)( ranges ); j++) {
             AddrRange* range = (AddrRange*) VG_(indexXA)( ranges, j );
             ML_(addInlInfo) (cc->di,
-                             range->aMin, range->aMax+1,
+                             range->aMin   + cc->di->text_debug_bias,
+                             range->aMax+1 + cc->di->text_debug_bias,
                              // aMax+1 as range has its last bound included
                              // while ML_(addInlInfo) expects last bound not
                              // included.