[Lldb-commits] [PATCH] D22756: Fix incorrect form test in SymbolFileDWARF

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 25 07:08:14 PDT 2016

labath created this revision.
labath added a reviewer: clayborg.
labath added a subscriber: lldb-commits.

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.



Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -4292,7 +4292,7 @@
                             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();
Index: source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
--- source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -556,6 +556,7 @@
     switch (form)
+    case DW_FORM_exprloc:
     case DW_FORM_block:
     case DW_FORM_block1:
     case DW_FORM_block2:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22756.65340.patch
Type: text/x-patch
Size: 1074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160725/72ab7e08/attachment.bin>

More information about the lldb-commits mailing list