summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2016-01-11 14:56:05 +0000
committerTamas Berghammer <tberghammer@google.com>2016-01-11 14:56:05 +0000
commit1966ac36a62c6d0168a8313c099dda5eb264f1a2 (patch)
tree411922120a1386bb74b74512688bbb6840801cb0
parent1395dbdbc64003a706c8f2a54c816eb0c7d0baf1 (diff)
downloadbcm5719-llvm-1966ac36a62c6d0168a8313c099dda5eb264f1a2.tar.gz
bcm5719-llvm-1966ac36a62c6d0168a8313c099dda5eb264f1a2.zip
Don't try to parse the line table when it isn't specified
Previously we tried to parse the line table even if a compile unit had no DW_AT_stmt_list atribute. The problem happens when a compiler generates debug info for a compile unit but doesn't generate any line info. llvm-svn: 257335
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 423b73de936..2088864bf6b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1065,12 +1065,17 @@ SymbolFileDWARF::ParseCompileUnitSupportFiles (const SymbolContext& sc, FileSpec
const char * cu_comp_dir = resolveCompDir(cu_die.GetAttributeValueAsString(DW_AT_comp_dir, nullptr));
const dw_offset_t stmt_list = cu_die.GetAttributeValueAsUnsigned(DW_AT_stmt_list, DW_INVALID_OFFSET);
-
- // All file indexes in DWARF are one based and a file of index zero is
- // supposed to be the compile unit itself.
- support_files.Append (*sc.comp_unit);
-
- return DWARFDebugLine::ParseSupportFiles(sc.comp_unit->GetModule(), get_debug_line_data(), cu_comp_dir, stmt_list, support_files);
+ if (stmt_list != DW_INVALID_OFFSET)
+ {
+ // All file indexes in DWARF are one based and a file of index zero is
+ // supposed to be the compile unit itself.
+ support_files.Append (*sc.comp_unit);
+ return DWARFDebugLine::ParseSupportFiles(sc.comp_unit->GetModule(),
+ get_debug_line_data(),
+ cu_comp_dir,
+ stmt_list,
+ support_files);
+ }
}
}
return false;
OpenPOWER on IntegriCloud