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/include | |
| 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/include')
| -rw-r--r-- | lldb/include/lldb/Symbol/CompileUnit.h | 20 | ||||
| -rw-r--r-- | lldb/include/lldb/Symbol/SymbolFile.h | 5 | ||||
| -rw-r--r-- | lldb/include/lldb/Symbol/SymbolVendor.h | 5 |
3 files changed, 24 insertions, 6 deletions
diff --git a/lldb/include/lldb/Symbol/CompileUnit.h b/lldb/include/lldb/Symbol/CompileUnit.h index 0c331c38f8c..2f596f89ec5 100644 --- a/lldb/include/lldb/Symbol/CompileUnit.h +++ b/lldb/include/lldb/Symbol/CompileUnit.h @@ -68,11 +68,16 @@ public: /// of this compile unit. /// /// @param[in] is_optimized - /// true if this compile unit was compiled with optimization. + /// A value that can initialized with eLazyBoolYes, eLazyBoolNo + /// or eLazyBoolCalculate. If set to eLazyBoolCalculate, then + /// an extra call into SymbolVendor will be made to calculate if + /// the compile unit is optimized will be made when + /// CompileUnit::GetIsOptimized() is called. /// /// @see lldb::LanguageType //------------------------------------------------------------------ - CompileUnit(const lldb::ModuleSP &module_sp, void *user_data, const char *pathname, lldb::user_id_t uid, lldb::LanguageType language, bool is_optimized); + CompileUnit(const lldb::ModuleSP &module_sp, void *user_data, const char *pathname, lldb::user_id_t uid, + lldb::LanguageType language, lldb_private::LazyBool is_optimized); //------------------------------------------------------------------ /// Construct with a module, file spec, UID and language. @@ -103,11 +108,16 @@ public: /// of this compile unit. /// /// @param[in] is_optimized - /// true if this compile unit was compiled with optimization. + /// A value that can initialized with eLazyBoolYes, eLazyBoolNo + /// or eLazyBoolCalculate. If set to eLazyBoolCalculate, then + /// an extra call into SymbolVendor will be made to calculate if + /// the compile unit is optimized will be made when + /// CompileUnit::GetIsOptimized() is called. /// /// @see lldb::LanguageType //------------------------------------------------------------------ - CompileUnit(const lldb::ModuleSP &module_sp, void *user_data, const FileSpec &file_spec, lldb::user_id_t uid, lldb::LanguageType language, bool is_optimized); + CompileUnit(const lldb::ModuleSP &module_sp, void *user_data, const FileSpec &file_spec, lldb::user_id_t uid, + lldb::LanguageType language, lldb_private::LazyBool is_optimized); //------------------------------------------------------------------ /// Destructor @@ -446,7 +456,7 @@ protected: std::unique_ptr<LineTable> m_line_table_ap; ///< Line table that will get parsed on demand. DebugMacrosSP m_debug_macros_sp; ///< Debug macros that will get parsed on demand. lldb::VariableListSP m_variables; ///< Global and static variable list that will get parsed on demand. - bool m_is_optimized; /// eLazyBoolYes if this compile unit was compiled with optimization. + lldb_private::LazyBool m_is_optimized; /// eLazyBoolYes if this compile unit was compiled with optimization. private: enum diff --git a/lldb/include/lldb/Symbol/SymbolFile.h b/lldb/include/lldb/Symbol/SymbolFile.h index b555ecd4d13..db97ab4f9b6 100644 --- a/lldb/include/lldb/Symbol/SymbolFile.h +++ b/lldb/include/lldb/Symbol/SymbolFile.h @@ -127,6 +127,11 @@ public: virtual bool ParseCompileUnitLineTable (const SymbolContext& sc) = 0; virtual bool ParseCompileUnitDebugMacros (const SymbolContext& sc) = 0; virtual bool ParseCompileUnitSupportFiles (const SymbolContext& sc, FileSpecList& support_files) = 0; + virtual bool + ParseCompileUnitIsOptimized(const lldb_private::SymbolContext &sc) + { + return false; + } virtual bool ParseImportedModules (const SymbolContext &sc, std::vector<ConstString> &imported_modules) = 0; virtual size_t ParseFunctionBlocks (const SymbolContext& sc) = 0; virtual size_t ParseTypes (const SymbolContext& sc) = 0; diff --git a/lldb/include/lldb/Symbol/SymbolVendor.h b/lldb/include/lldb/Symbol/SymbolVendor.h index dbea8c96573..e992c5cde60 100644 --- a/lldb/include/lldb/Symbol/SymbolVendor.h +++ b/lldb/include/lldb/Symbol/SymbolVendor.h @@ -68,7 +68,10 @@ public: virtual bool ParseCompileUnitSupportFiles (const SymbolContext& sc, FileSpecList& support_files); - + + virtual bool + ParseCompileUnitIsOptimized(const SymbolContext &sc); + virtual bool ParseImportedModules (const SymbolContext &sc, std::vector<ConstString> &imported_modules); |

