From 57d053511fbd1f2dd30f6d5cc729846f0e0aa3e3 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Tue, 26 Jul 2016 08:16:19 +0000 Subject: [PATCH] Fix incorrect form test in SymbolFileDWARF Summary: We were checking whether an attribute is in block form by getting the block data pointer, which was not correct as the pointer be null even if the attribute is in block form. Other places in the file already use the correct test. To make this work, I've needed to add DW_FORM_exprlock to the list of "block" forms, which seems correct as that is how we are parsing it. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D22756 llvm-svn: 276735 --- lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp | 1 + lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp index addc148..f8d137f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -556,6 +556,7 @@ DWARFFormValue::IsBlockForm(const dw_form_t form) { switch (form) { + case DW_FORM_exprloc: case DW_FORM_block: case DW_FORM_block1: case DW_FORM_block2: diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 4591c0a..bf27ccb 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -4292,7 +4292,7 @@ SymbolFileDWARF::ParseVariableDIE { location_is_const_value_data = false; has_explicit_location = true; - if (form_value.BlockData()) + if (DWARFFormValue::IsBlockForm(form_value.Form())) { const DWARFDataExtractor& debug_info_data = get_debug_info_data(); -- 2.7.4