|
[Valgrind-developers] [valgrind] readdwarf3: Immediately skip to
end of CU when not parsing children
From: Mark W. <ma...@so...> - 2021-09-24 21:03:22
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0a543c57c8ffca25f4817750317c981ea2d84311 commit 0a543c57c8ffca25f4817750317c981ea2d84311 Author: Mark Wielaard <ma...@kl...> Date: Sat Sep 18 03:23:52 2021 +0200 readdwarf3: Immediately skip to end of CU when not parsing children Diff: --- coregrind/m_debuginfo/readdwarf3.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c index e63e357881..b02e239900 100644 --- a/coregrind/m_debuginfo/readdwarf3.c +++ b/coregrind/m_debuginfo/readdwarf3.c @@ -4787,6 +4787,16 @@ static void read_DIE ( vg_assert (inlparser->sibling == 0 || inlparser->sibling == sibling); } + /* Top level CU DIE, but we don't want to read anything else, just skip + to the end and return. */ + if (level == 0 && !parse_children) { + UWord cu_size_including_IniLen = (cc->unit_length + + (cc->is_dw64 ? 12 : 4)); + set_position_of_Cursor( c, (cc->cu_start_offset + + cu_size_including_IniLen)); + return; + } + if (after_die_c_offset > 0) { // DIE was read by a parser above, so we know where the DIE ends. set_position_of_Cursor( c, after_die_c_offset ); |