Dwarf5 fixes [4 of 5]: Skip processing Dwarf5 type units.

Fourth of 5 small patches to fix various breakpad issues found
while testing dump_syms on DWARF v5 in ChromeOS.

Dwarfv5 adds many new Type Unit sections to debug information. Since
these only contain type information, they are of no interest to
dump_syms.  This CL gets dump_syms to skip trying to process the
type unit sections.  Without this CL, dump_syms takes ~ 3 hours to
process the DWARF v5 Chrome binary.  With this CL, dump_syms takes
~ 8 minutes to process the DWARF v5 Chrome binary (about the same
time as it takes for DWARF v4).

This CL also adds a test case to verify that type units are being
skipped.

Change-Id: Ie0bb2d675718f7041b8e9b3186ed44f80a3ad39c
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2634549
Reviewed-by: Sterling Augustine <saugustine@google.com>
This commit is contained in:
Caroline Tice 2021-01-16 17:05:32 -08:00 committed by Sterling Augustine
parent 646f0f4920
commit 3c528da94c
4 changed files with 128 additions and 63 deletions

View file

@ -74,7 +74,7 @@ CompilationUnit::CompilationUnit(const string& path,
line_string_buffer_(NULL), line_string_buffer_length_(0),
str_offsets_buffer_(NULL), str_offsets_buffer_length_(0),
addr_buffer_(NULL), addr_buffer_length_(0),
is_split_dwarf_(false), dwo_id_(0), dwo_name_(),
is_split_dwarf_(false), is_type_unit_(false), dwo_id_(0), dwo_name_(),
skeleton_dwo_id_(0), ranges_base_(0), addr_base_(0),
str_offsets_base_(0), have_checked_for_dwp_(false), dwp_path_(),
dwp_byte_reader_(), dwp_reader_() {}
@ -358,6 +358,7 @@ void CompilationUnit::ReadHeader() {
break;
case DW_UT_type:
case DW_UT_split_type:
is_type_unit_ = true;
headerptr += ReadTypeSignature(headerptr);
headerptr += ReadTypeOffset(headerptr);
break;
@ -404,6 +405,8 @@ uint64_t CompilationUnit::Start() {
header_.length,
header_.version))
return ourlength;
else if (header_.version == 5 && is_type_unit_)
return ourlength;
// Otherwise, continue by reading our abbreviation entries.
ReadAbbrevs();