From: Philippe Waroquiers Date: Tue, 5 Aug 2014 19:34:35 +0000 (+0000) Subject: fix 338024 inlined functions are not shown if DW_AT_ranges is used X-Git-Tag: svn/VALGRIND_3_10_0~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24e0fbf92a90fdf9cb22ea93f559d57c087a02cd;p=thirdparty%2Fvalgrind.git fix 338024 inlined functions are not shown if DW_AT_ranges is used 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 --- diff --git a/NEWS b/NEWS index 01e985d369..dd814525be 100644 --- 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 diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c index 7f7f3e9dbc..c5234a1e9b 100644 --- a/coregrind/m_debuginfo/readdwarf3.c +++ b/coregrind/m_debuginfo/readdwarf3.c @@ -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.