diff options
Diffstat (limited to 'lldb/source/Symbol/SymbolContext.cpp')
| -rw-r--r-- | lldb/source/Symbol/SymbolContext.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index f1c3a9e5b4e0..a10db0755d03 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/source/Symbol/SymbolContext.cpp @@ -8,6 +8,7 @@ #include "lldb/Symbol/SymbolContext.h" +#include "lldb/Core/Debugger.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Host/Host.h" @@ -19,6 +20,7 @@ #include "lldb/Symbol/SymbolVendor.h" #include "lldb/Symbol/Variable.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" @@ -30,7 +32,7 @@ SymbolContext::SymbolContext() : target_sp(), module_sp(), line_entry() {} SymbolContext::SymbolContext(const ModuleSP &m, CompileUnit *cu, Function *f, Block *b, LineEntry *le, Symbol *s) : target_sp(), module_sp(m), comp_unit(cu), function(f), block(b), - line_entry(), symbol(s), variable(nullptr) { + line_entry(), symbol(s) { if (le) line_entry = *le; } @@ -39,14 +41,13 @@ SymbolContext::SymbolContext(const TargetSP &t, const ModuleSP &m, CompileUnit *cu, Function *f, Block *b, LineEntry *le, Symbol *s) : target_sp(t), module_sp(m), comp_unit(cu), function(f), block(b), - line_entry(), symbol(s), variable(nullptr) { + line_entry(), symbol(s) { if (le) line_entry = *le; } SymbolContext::SymbolContext(SymbolContextScope *sc_scope) - : target_sp(), module_sp(), comp_unit(nullptr), function(nullptr), - block(nullptr), line_entry(), symbol(nullptr), variable(nullptr) { + : target_sp(), module_sp(), line_entry() { sc_scope->CalculateSymbolContext(this); } @@ -477,7 +478,7 @@ bool SymbolContext::GetParentOfInlinedScope(const Address &curr_frame_pc, curr_inlined_block_inlined_info->GetCallSite().GetColumn(); return true; } else { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SYMBOLS)); + Log *log = GetLog(LLDBLog::Symbols); if (log) { LLDB_LOGF( @@ -494,20 +495,16 @@ bool SymbolContext::GetParentOfInlinedScope(const Address &curr_frame_pc, objfile = symbol_file->GetObjectFile(); } if (objfile) { - Host::SystemLog( - Host::eSystemLogWarning, - "warning: inlined block 0x%8.8" PRIx64 - " doesn't have a range that contains file address 0x%" PRIx64 - " in %s\n", + Debugger::ReportWarning(llvm::formatv( + "inlined block {0:x} doesn't have a range that contains file " + "address {1:x} in {2}", curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress(), - objfile->GetFileSpec().GetPath().c_str()); + objfile->GetFileSpec().GetPath())); } else { - Host::SystemLog( - Host::eSystemLogWarning, - "warning: inlined block 0x%8.8" PRIx64 - " doesn't have a range that contains file address 0x%" PRIx64 - "\n", - curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress()); + Debugger::ReportWarning(llvm::formatv( + "inlined block {0:x} doesn't have a range that contains file " + "address {1:x}", + curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress())); } } #endif @@ -960,8 +957,9 @@ bool SymbolContextSpecifier::AddSpecification(const char *spec_string, // See if we can find the Module, if so stick it in the SymbolContext. FileSpec module_file_spec(spec_string); ModuleSpec module_spec(module_file_spec); - lldb::ModuleSP module_sp( - m_target_sp->GetImages().FindFirstModule(module_spec)); + lldb::ModuleSP module_sp = + m_target_sp ? m_target_sp->GetImages().FindFirstModule(module_spec) + : nullptr; m_type |= eModuleSpecified; if (module_sp) m_module_sp = module_sp; |
