mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-03-10 20:56:28 +00:00
Support miscelaneous dwarf5 forms.
Most of this is simple, "Read the form, get the data, then call ProcessAttribute." Handling DW_FORM_implcit_const is a little trickier, as it is the only form that stores its value inline in the abbrev table itself. Add a test for that. Print errors for supplementary object files. Change-Id: I0999b039848bded1891998a866e5059acd538a09 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2446627 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
@@ -463,6 +463,35 @@ TEST_P(DwarfForms, ref_sig8_not_first) {
|
||||
ParseCompilationUnit(GetParam(), 98);
|
||||
}
|
||||
|
||||
TEST_P(DwarfForms, implicit_const) {
|
||||
const DwarfHeaderParams& params = GetParam();
|
||||
const uint64_t implicit_constant_value = 0x1234;
|
||||
// Create the abbreviation table.
|
||||
Label abbrev_table = abbrevs.Here();
|
||||
abbrevs.Abbrev(1, (DwarfTag) 0x253e7b2b, dwarf2reader::DW_children_no)
|
||||
.Attribute((DwarfAttribute) 0xd708d908,
|
||||
dwarf2reader::DW_FORM_implicit_const)
|
||||
.ULEB128(implicit_constant_value);
|
||||
abbrevs.EndAbbrev().EndTable();
|
||||
|
||||
info.set_format_size(params.format_size);
|
||||
info.set_endianness(params.endianness);
|
||||
info.Header(params.version, abbrev_table, params.address_size)
|
||||
.ULEB128(1); // abbrev code
|
||||
info.Finish();
|
||||
|
||||
ExpectBeginCompilationUnit(GetParam(), (DwarfTag) 0x253e7b2b);
|
||||
EXPECT_CALL(handler,
|
||||
ProcessAttributeUnsigned(_, (DwarfAttribute) 0xd708d908,
|
||||
dwarf2reader::DW_FORM_implicit_const,
|
||||
implicit_constant_value))
|
||||
.InSequence(s)
|
||||
.WillOnce(Return());
|
||||
ExpectEndCompilationUnit();
|
||||
|
||||
ParseCompilationUnit(GetParam());
|
||||
}
|
||||
|
||||
// Tests for the other attribute forms could go here.
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
|
||||
Reference in New Issue
Block a user