aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-dwp/llvm-dwp.cpp
diff options
context:
space:
mode:
authorIgor Kudrin <ikudrin@accesssoftek.com>2020-03-20 23:26:56 +0700
committerIgor Kudrin <ikudrin@accesssoftek.com>2020-04-06 13:28:06 +0700
commit714324b79ae2d05bedfbbb061cfbff4645e6e01b (patch)
treeea97c398b47f8ed1686469d0727ea3927b200640 /llvm/tools/llvm-dwp/llvm-dwp.cpp
parenta0249fe91c7ba0dabf0e8789171fb4aea5fca1cb (diff)
downloadllvm-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.cpp7
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