forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1593966 - Add minimal support for the DW_FORM_GNU_ref_alt and DW_…
…FORM_GNU_strp_alt operand forms in dump_syms r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D51801 --HG-- extra : moz-landing-system : lando
- Loading branch information
1 parent
167a3b6
commit 07eecc7
Showing
3 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
85 changes: 85 additions & 0 deletions
85
toolkit/crashreporter/breakpad-patches/09-gnu-alt-form-minimal-support.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# HG changeset patch | ||
# User Gabriele Svelto <[email protected]> | ||
# Date 1572953718 -3600 | ||
# Tue Nov 05 12:35:18 2019 +0100 | ||
# Node ID 229ab2882283fb1a080486bceda9db729525e78c | ||
# Parent 53ebedebdb63ded40f5f3fef677ccc60fa6deeac | ||
Bug 1593966 - Add minimal support for the DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt operand forms in dump_syms | ||
|
||
diff --git a/src/common/dwarf/dwarf2enums.h b/src/common/dwarf/dwarf2enums.h | ||
--- a/src/common/dwarf/dwarf2enums.h | ||
+++ b/src/common/dwarf/dwarf2enums.h | ||
@@ -147,17 +147,22 @@ enum DwarfForm { | ||
|
||
// Added in DWARF 4: | ||
DW_FORM_sec_offset = 0x17, | ||
DW_FORM_exprloc = 0x18, | ||
DW_FORM_flag_present = 0x19, | ||
DW_FORM_ref_sig8 = 0x20, | ||
// Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. | ||
DW_FORM_GNU_addr_index = 0x1f01, | ||
- DW_FORM_GNU_str_index = 0x1f02 | ||
+ DW_FORM_GNU_str_index = 0x1f02, | ||
+ | ||
+ // Extensions introduced for the dwz compression tool. See | ||
+ // https://fedoraproject.org/wiki/Features/DwarfCompressor | ||
+ DW_FORM_GNU_ref_alt = 0x1f20, | ||
+ DW_FORM_GNU_strp_alt = 0x1f21, | ||
}; | ||
|
||
// Attribute names and codes | ||
enum DwarfAttribute { | ||
DW_AT_sibling = 0x01, | ||
DW_AT_location = 0x02, | ||
DW_AT_name = 0x03, | ||
DW_AT_ordering = 0x09, | ||
diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc | ||
--- a/src/common/dwarf/dwarf2reader.cc | ||
+++ b/src/common/dwarf/dwarf2reader.cc | ||
@@ -219,16 +219,21 @@ const uint8_t *CompilationUnit::SkipAttr | ||
assert(header_.version >= 2); | ||
if (header_.version == 2) { | ||
return start + reader_->AddressSize(); | ||
} else if (header_.version >= 3) { | ||
return start + reader_->OffsetSize(); | ||
} | ||
break; | ||
|
||
+ case DW_FORM_GNU_ref_alt: | ||
+ case DW_FORM_GNU_strp_alt: | ||
+ return start + reader_->OffsetSize(); | ||
+ break; | ||
+ | ||
case DW_FORM_block1: | ||
return start + 1 + reader_->ReadOneByte(start); | ||
case DW_FORM_block2: | ||
return start + 2 + reader_->ReadTwoBytes(start); | ||
case DW_FORM_block4: | ||
return start + 4 + reader_->ReadFourBytes(start); | ||
case DW_FORM_block: | ||
case DW_FORM_exprloc: { | ||
@@ -515,16 +520,24 @@ const uint8_t *CompilationUnit::ProcessA | ||
case DW_FORM_GNU_addr_index: { | ||
uint64 addr_index = reader_->ReadUnsignedLEB128(start, &len); | ||
const uint8_t* addr_ptr = | ||
addr_buffer_ + addr_base_ + addr_index * reader_->AddressSize(); | ||
ProcessAttributeUnsigned(dieoffset, attr, form, | ||
reader_->ReadAddress(addr_ptr)); | ||
return start + len; | ||
} | ||
+ case DW_FORM_GNU_ref_alt: { | ||
+ // TODO: This effectively ignores attributes stored in alternate object | ||
+ // files. We should process them properly instead. | ||
+ return start + reader_->OffsetSize(); | ||
+ } | ||
+ case DW_FORM_GNU_strp_alt: { | ||
+ return start + reader_->OffsetSize(); | ||
+ } | ||
} | ||
fprintf(stderr, "Unhandled form type\n"); | ||
return NULL; | ||
} | ||
|
||
const uint8_t *CompilationUnit::ProcessDIE(uint64 dieoffset, | ||
const uint8_t *start, | ||
const Abbrev& abbrev) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters