From 2104040e03a37a456b8adf2d86c1358d6ee7610e Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Fri, 11 Nov 2016 17:38:14 +0000 Subject: [PATCH] Fixed issues found by Paul Robinson with my patch for: https://reviews.llvm.org/D26526 - Fixed DW_FORM_strp to be correctly sized and extracted for DWARF64 - Added some missing strp variants as well - Fixed comment typo git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286603 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/DWARF/DWARFFormValue.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/DebugInfo/DWARF/DWARFFormValue.cpp b/lib/DebugInfo/DWARF/DWARFFormValue.cpp index dcb491fdd80..b3f1a52e6b7 100644 --- a/lib/DebugInfo/DWARF/DWARFFormValue.cpp +++ b/lib/DebugInfo/DWARF/DWARFFormValue.cpp @@ -128,9 +128,9 @@ static Optional getFixedByteSize(dwarf::Form Form, const T *U) { case DW_FORM_data4: case DW_FORM_ref4: - case DW_FORM_strp: return 4; + case DW_FORM_strp: case DW_FORM_GNU_ref_alt: case DW_FORM_GNU_strp_alt: case DW_FORM_line_strp: @@ -169,7 +169,7 @@ static bool skipFormValue(dwarf::Form Form, const DataExtractor &DebugInfoData, bool Indirect = false; do { switch (Form) { - // Blocks if inlined data that have a length field and the data bytes + // Blocks of inlined data that have a length field and the data bytes // inlined in the .debug_info. case DW_FORM_exprloc: case DW_FORM_block: { @@ -211,8 +211,11 @@ static bool skipFormValue(dwarf::Form Form, const DataExtractor &DebugInfoData, case DW_FORM_ref4: case DW_FORM_ref8: case DW_FORM_ref_sig8: + case DW_FORM_ref_sup: case DW_FORM_sec_offset: case DW_FORM_strp: + case DW_FORM_strp_sup: + case DW_FORM_line_strp: case DW_FORM_GNU_ref_alt: case DW_FORM_GNU_strp_alt: if (Optional FixedSize = ::getFixedByteSize(Form, U)) { @@ -341,8 +344,7 @@ bool DWARFFormValue::extractValue(const DataExtractor &data, Value.uval = data.getU16(offset_ptr); break; case DW_FORM_data4: - case DW_FORM_ref4: - case DW_FORM_strp: { + case DW_FORM_ref4: { Value.uval = data.getU32(offset_ptr); if (!U) break; @@ -369,6 +371,7 @@ bool DWARFFormValue::extractValue(const DataExtractor &data, Form = static_cast(data.getULEB128(offset_ptr)); indirect = true; break; + case DW_FORM_strp: case DW_FORM_sec_offset: case DW_FORM_GNU_ref_alt: case DW_FORM_GNU_strp_alt: -- 2.40.0