[Lldb-commits] [PATCH] D73921: Assert that a subprogram should have a name when parsing DWARF

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 3 13:24:11 PST 2020


shafik created this revision.
shafik added reviewers: aprantl, jingham, labath, JDevlieghere.

This is just an enforcement of the DWARF requirement that a `DW_TAG_subprogram` should have a `DW_AT_name`.

This came up when updating how we generating some debug info and one of the possible change caused several LLDB tests to fail. This was ultimately due to subprograms being generated without names but the immediate symptom did not point to that.


https://reviews.llvm.org/D73921

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp


Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -828,6 +828,11 @@
   SymbolFileDWARF *dwarf = die.GetDWARF();
   const dw_tag_t tag = die.Tag();
 
+  if (tag == DW_TAG_subprogram && !attrs.name) {
+    LLDB_LOGF(log, "Parsing a Subprogram that has no name");
+    assert(false && "Subprograms require a name");
+  }
+
   bool is_variadic = false;
   bool is_static = false;
   bool has_template_params = false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73921.242163.patch
Type: text/x-patch
Size: 632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200203/a800a2b8/attachment.bin>


More information about the lldb-commits mailing list