diff options
| author | Greg Clayton <gclayton@apple.com> | 2016-07-05 23:01:20 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2016-07-05 23:01:20 +0000 |
| commit | ad2b63cbaa33c0edcd378deb70caf3610c49ca2e (patch) | |
| tree | 97d532c1a85ce35ded9a76e54388d4c7191a42b0 /lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | |
| parent | be22e5ccbea07806a99510484dd432c8f1ac611b (diff) | |
| download | bcm5719-llvm-ad2b63cbaa33c0edcd378deb70caf3610c49ca2e.tar.gz bcm5719-llvm-ad2b63cbaa33c0edcd378deb70caf3610c49ca2e.zip | |
Warning about debugging optimized code was not happening without dSYMs. Now it works for DWARF in .o files on Darwin.
I changed "m_is_optimized" in lldb_private::CompileUnit over to be a lldb::LazyBool so that it can be set to eLazyBoolCalculate if it needs to be parsed later. With SymbolFileDWARFDebugMap, we don't actually open the DWARF in the .o files for each compile unit until later, and we can't tell if a compile unit is optimized ahead of time. So to avoid pulling in all .o right away just so we can answer the questions of "is this compile unit optimized" we defer it until a point where we will have the compile unit parsed.
<rdar://problem/26068360>
llvm-svn: 274585
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index e0a5973f854..942a5d62d9b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -915,12 +915,8 @@ SymbolFileDWARF::ParseCompileUnit (DWARFCompileUnit* dwarf_cu, uint32_t cu_idx) LanguageType cu_language = DWARFCompileUnit::LanguageTypeFromDWARF(cu_die.GetAttributeValueAsUnsigned(DW_AT_language, 0)); bool is_optimized = dwarf_cu->GetIsOptimized (); - cu_sp.reset(new CompileUnit (module_sp, - dwarf_cu, - cu_file_spec, - dwarf_cu->GetID(), - cu_language, - is_optimized)); + cu_sp.reset(new CompileUnit(module_sp, dwarf_cu, cu_file_spec, dwarf_cu->GetID(), cu_language, + is_optimized ? eLazyBoolYes : eLazyBoolNo)); if (cu_sp) { // If we just created a compile unit with an invalid file spec, try and get the @@ -1070,7 +1066,17 @@ SymbolFileDWARF::ParseCompileUnitSupportFiles (const SymbolContext& sc, FileSpec } bool -SymbolFileDWARF::ParseImportedModules (const lldb_private::SymbolContext &sc, std::vector<lldb_private::ConstString> &imported_modules) +SymbolFileDWARF::ParseCompileUnitIsOptimized(const lldb_private::SymbolContext &sc) +{ + DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); + if (dwarf_cu) + return dwarf_cu->GetIsOptimized(); + return false; +} + +bool +SymbolFileDWARF::ParseImportedModules(const lldb_private::SymbolContext &sc, + std::vector<lldb_private::ConstString> &imported_modules) { assert (sc.comp_unit); DWARFCompileUnit* dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); |

