|
From: Mark W. <ma...@so...> - 2021-09-24 21:03:10
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b4a6b165baf28b7371495f6c1f12bf745ff52d02 commit b4a6b165baf28b7371495f6c1f12bf745ff52d02 Author: Mark Wielaard <ma...@kl...> Date: Thu Sep 16 22:49:41 2021 +0200 readdwarf3: Only read line table for units with addresses for inlined functions When parsing DIEs for inlined functions, only read the line table for units which can actually contain inlined_subroutines. Diff: --- coregrind/m_debuginfo/readdwarf3.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c index cf8270c8cf..7ece770090 100644 --- a/coregrind/m_debuginfo/readdwarf3.c +++ b/coregrind/m_debuginfo/readdwarf3.c @@ -3134,6 +3134,8 @@ static Bool parse_inl_DIE ( Bool have_lo = False; Addr ip_lo = 0; const HChar *compdir = NULL; + Bool has_stmt_list = False; + ULong debug_line_offset = 0; nf_i = 0; while (True) { @@ -3159,15 +3161,19 @@ static Bool parse_inl_DIE ( ML_(dinfo_free) (str); } if (attr == DW_AT_stmt_list && cts.szB > 0) { - read_filename_table( parser->fndn_ix_Table, compdir, - cc, cts.u.val, td3 ); + has_stmt_list = True; + debug_line_offset = cts.u.val; } if (attr == DW_AT_sibling && cts.szB > 0) { parser->sibling = cts.u.val; } } - if (level == 0) + if (level == 0) { setup_cu_svma (cc, have_lo, ip_lo, td3); + if (has_stmt_list && unit_has_addrs) + read_filename_table( parser->fndn_ix_Table, compdir, + cc, debug_line_offset, td3 ); + } } if (dtag == DW_TAG_inlined_subroutine) { |