summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
diff options
context:
space:
mode:
authorWolfgang Pieb <Wolfgang.Pieb@sony.com>2017-06-06 01:22:34 +0000
committerWolfgang Pieb <Wolfgang.Pieb@sony.com>2017-06-06 01:22:34 +0000
commit77d3e938f846a8c02b0d4db59840d10f9b4dca54 (patch)
tree244bac1cccb6e7d89c9f6ee68a5bf7f61654e6bd /llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
parent7bda19581229e4b78ccab72a2102d251cc1ab279 (diff)
downloadbcm5719-llvm-77d3e938f846a8c02b0d4db59840d10f9b4dca54.tar.gz
bcm5719-llvm-77d3e938f846a8c02b0d4db59840d10f9b4dca54.zip
[DWARF] Adding support for the DWARF v5 string offsets table (consumer/reader part only).
Reviewers: dblaikie, aprantl Differential Revision: https://reviews.llvm.org/D32779 llvm-svn: 304759
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
index 0963d7bfd71..8d23a9a438d 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
@@ -301,6 +301,7 @@ bool DWARFFormValue::isFormClass(DWARFFormValue::FormClass FC) const {
return (FC == FC_Address);
case DW_FORM_GNU_str_index:
case DW_FORM_GNU_strp_alt:
+ case DW_FORM_strx:
return (FC == FC_String);
case DW_FORM_implicit_const:
return (FC == FC_Constant);
@@ -415,6 +416,7 @@ bool DWARFFormValue::extractValue(const DataExtractor &Data,
break;
case DW_FORM_GNU_addr_index:
case DW_FORM_GNU_str_index:
+ case DW_FORM_strx:
Value.uval = Data.getULEB128(OffsetPtr);
break;
default:
@@ -542,6 +544,7 @@ void DWARFFormValue::dump(raw_ostream &OS) const {
OS << format(" .debug_str[0x%8.8x] = ", (uint32_t)UValue);
dumpString(OS);
break;
+ case DW_FORM_strx:
case DW_FORM_GNU_str_index:
OS << format(" indexed (%8.8x) string = ", (uint32_t)UValue);
dumpString(OS);
@@ -620,10 +623,11 @@ Optional<const char *> DWARFFormValue::getAsCString() const {
if (Form == DW_FORM_GNU_strp_alt || U == nullptr)
return None;
uint32_t Offset = Value.uval;
- if (Form == DW_FORM_GNU_str_index) {
- uint32_t StrOffset;
+ if (Form == DW_FORM_GNU_str_index || Form == DW_FORM_strx) {
+ uint64_t StrOffset;
if (!U->getStringOffsetSectionItem(Offset, StrOffset))
return None;
+ StrOffset += U->getStringOffsetSectionRelocation(Offset);
Offset = StrOffset;
}
if (const char *Str = U->getStringExtractor().getCStr(&Offset)) {
OpenPOWER on IntegriCloud