diff options
author | Igor Kudrin <ikudrin@accesssoftek.com> | 2020-03-20 23:26:56 +0700 |
---|---|---|
committer | Igor Kudrin <ikudrin@accesssoftek.com> | 2020-04-06 13:28:06 +0700 |
commit | 714324b79ae2d05bedfbbb061cfbff4645e6e01b (patch) | |
tree | ea97c398b47f8ed1686469d0727ea3927b200640 /llvm/tools/llvm-dwp/llvm-dwp.cpp | |
parent | a0249fe91c7ba0dabf0e8789171fb4aea5fca1cb (diff) | |
download | llvm-714324b79ae2d05bedfbbb061cfbff4645e6e01b.zip llvm-714324b79ae2d05bedfbbb061cfbff4645e6e01b.tar.gz llvm-714324b79ae2d05bedfbbb061cfbff4645e6e01b.tar.bz2 |
[DebugInfo] Support DWARFv5 index sections.
DWARFv5 defines index sections in package files in a slightly different
way than the pre-standard GNU proposal, see Section 7.3.5 in the DWARF
standard and https://gcc.gnu.org/wiki/DebugFissionDWP for GNU proposal.
The main concern here is values for section identifiers, which are
partially overlapped with changed meanings. The patch adds support for
v5 index sections and resolves that difficulty by defining a set of
identifiers for internal use which can represent and distinct values
of both standards.
Differential Revision: https://reviews.llvm.org/D75929
Diffstat (limited to 'llvm/tools/llvm-dwp/llvm-dwp.cpp')
-rw-r--r-- | llvm/tools/llvm-dwp/llvm-dwp.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp index 571dc62..18cd92f 100644 --- a/llvm/tools/llvm-dwp/llvm-dwp.cpp +++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -216,11 +216,12 @@ struct UnitIndexEntry { StringRef DWPName; }; -// Convert a section identifier into the index to use with +// Convert an internal section identifier into the index to use with // UnitIndexEntry::Contributions. static unsigned getContributionIndex(DWARFSectionKind Kind) { - assert(Kind >= DW_SECT_INFO); - return Kind - DW_SECT_INFO; + // Assuming the pre-standard DWP format. + assert(serializeSectionKind(Kind, 2) >= DW_SECT_INFO); + return serializeSectionKind(Kind, 2) - DW_SECT_INFO; } // Convert a UnitIndexEntry::Contributions index to the corresponding on-disk |