summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Symbol/SymbolContext.h2
-rw-r--r--lldb/source/API/SBSymbolContext.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectSource.cpp4
-rw-r--r--lldb/source/Core/Address.cpp2
-rw-r--r--lldb/source/Core/Disassembler.cpp2
-rw-r--r--lldb/source/Core/Module.cpp4
-rw-r--r--lldb/source/Expression/ClangExpressionDeclMap.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp2
-rw-r--r--lldb/source/Symbol/SymbolContext.cpp7
-rw-r--r--lldb/source/Symbol/Variable.cpp2
-rw-r--r--lldb/source/Target/StackFrame.cpp2
12 files changed, 19 insertions, 18 deletions
diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h
index f6c05b0895b..719fac162c7 100644
--- a/lldb/include/lldb/Symbol/SymbolContext.h
+++ b/lldb/include/lldb/Symbol/SymbolContext.h
@@ -131,7 +131,7 @@ public:
/// to their default state.
//------------------------------------------------------------------
void
- Clear ();
+ Clear (bool clear_target);
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
diff --git a/lldb/source/API/SBSymbolContext.cpp b/lldb/source/API/SBSymbolContext.cpp
index a310d25565c..780364cc787 100644
--- a/lldb/source/API/SBSymbolContext.cpp
+++ b/lldb/source/API/SBSymbolContext.cpp
@@ -72,7 +72,7 @@ SBSymbolContext::SetSymbolContext (const SymbolContext *sc_ptr)
else
{
if (m_opaque_ap.get())
- m_opaque_ap->Clear();
+ m_opaque_ap->Clear(true);
}
}
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp
index 0beaadf5728..d7daa497fe6 100644
--- a/lldb/source/Commands/CommandObjectSource.cpp
+++ b/lldb/source/Commands/CommandObjectSource.cpp
@@ -482,7 +482,7 @@ protected:
ModuleSP module_sp (module_list.GetModuleAtIndex(i));
if (module_sp && module_sp->ResolveFileAddress(m_options.address, so_addr))
{
- sc.Clear();
+ sc.Clear(true);
if (module_sp->ResolveSymbolContextForAddress (so_addr, eSymbolContextEverything, sc) & eSymbolContextLineEntry)
sc_list.Append(sc);
}
@@ -505,7 +505,7 @@ protected:
ModuleSP module_sp (so_addr.GetModule());
if (module_sp)
{
- sc.Clear();
+ sc.Clear(true);
if (module_sp->ResolveSymbolContextForAddress (so_addr, eSymbolContextEverything, sc) & eSymbolContextLineEntry)
{
sc_list.Append(sc);
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp
index 5c9ed1a51fb..66093bcc2e1 100644
--- a/lldb/source/Core/Address.cpp
+++ b/lldb/source/Core/Address.cpp
@@ -762,7 +762,7 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
uint32_t
Address::CalculateSymbolContext (SymbolContext *sc, uint32_t resolve_scope) const
{
- sc->Clear();
+ sc->Clear(false);
// Absolute addresses don't have enough information to reconstruct even their target.
SectionSP section_sp (GetSection());
diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp
index 0d29e01ecc9..b74238c65e6 100644
--- a/lldb/source/Core/Disassembler.cpp
+++ b/lldb/source/Core/Disassembler.cpp
@@ -445,7 +445,7 @@ Disassembler::PrintInstructions
}
else
{
- sc.Clear();
+ sc.Clear(true);
}
}
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 9490d2e2ece..953a81bfdbe 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -442,8 +442,8 @@ Module::ResolveSymbolContextForAddress (const Address& so_addr, uint32_t resolve
Mutex::Locker locker (m_mutex);
uint32_t resolved_flags = 0;
- // Clear the result symbol context in case we don't find anything
- sc.Clear();
+ // Clear the result symbol context in case we don't find anything, but don't clear the target
+ sc.Clear(false);
// Get the section from the section/offset address.
SectionSP section_sp (so_addr.GetSection());
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp
index 9851a466768..db1ef1684dd 100644
--- a/lldb/source/Expression/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp
@@ -86,12 +86,12 @@ ClangExpressionDeclMap::WillParse(ExecutionContext &exe_ctx)
m_parser_vars->m_sym_ctx = exe_ctx.GetThreadPtr()->GetStackFrameAtIndex(0)->GetSymbolContext(lldb::eSymbolContextEverything);
else if (exe_ctx.GetProcessPtr())
{
- m_parser_vars->m_sym_ctx.Clear();
+ m_parser_vars->m_sym_ctx.Clear(true);
m_parser_vars->m_sym_ctx.target_sp = exe_ctx.GetTargetSP();
}
else if (target)
{
- m_parser_vars->m_sym_ctx.Clear();
+ m_parser_vars->m_sym_ctx.Clear(true);
m_parser_vars->m_sym_ctx.target_sp = exe_ctx.GetTargetSP();
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index cb691c552f1..6b52a62ecb2 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -60,7 +60,7 @@ RegisterContextLLDB::RegisterContextLLDB
m_registers(),
m_parent_unwind (unwind_lldb)
{
- m_sym_ctx.Clear();
+ m_sym_ctx.Clear(false);
m_sym_ctx_valid = false;
if (IsFrameZero ())
@@ -409,7 +409,7 @@ RegisterContextLLDB::InitializeNonZerothFrame()
{
Address temporary_pc(m_current_pc);
temporary_pc.SetOffset(m_current_pc.GetOffset() - 1);
- m_sym_ctx.Clear();
+ m_sym_ctx.Clear(false);
m_sym_ctx_valid = false;
if ((pc_module_sp->ResolveSymbolContextForAddress (temporary_pc, eSymbolContextFunction| eSymbolContextSymbol, m_sym_ctx) & eSymbolContextSymbol) == eSymbolContextSymbol)
{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index d7e5db1d3d0..95e049c6c7d 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2564,7 +2564,7 @@ SymbolFileDWARF::GetCompUnitForDWARFCompUnit (DWARFCompileUnit* dwarf_cu, uint32
bool
SymbolFileDWARF::GetFunction (DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry* func_die, SymbolContext& sc)
{
- sc.Clear();
+ sc.Clear(false);
// Check if the symbol vendor already knows about this compile unit?
sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, UINT32_MAX);
diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp
index b3d9748a256..b4b777b52ff 100644
--- a/lldb/source/Symbol/SymbolContext.cpp
+++ b/lldb/source/Symbol/SymbolContext.cpp
@@ -108,9 +108,10 @@ SymbolContext::operator= (const SymbolContext& rhs)
}
void
-SymbolContext::Clear()
+SymbolContext::Clear(bool clear_target)
{
- target_sp.reset();
+ if (clear_target)
+ target_sp.reset();
module_sp.reset();
comp_unit = NULL;
function = NULL;
@@ -453,7 +454,7 @@ SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc,
SymbolContext &next_frame_sc,
Address &next_frame_pc) const
{
- next_frame_sc.Clear();
+ next_frame_sc.Clear(false);
next_frame_pc.Clear();
if (block)
diff --git a/lldb/source/Symbol/Variable.cpp b/lldb/source/Symbol/Variable.cpp
index 8172875f8a3..309e3926c87 100644
--- a/lldb/source/Symbol/Variable.cpp
+++ b/lldb/source/Symbol/Variable.cpp
@@ -203,7 +203,7 @@ Variable::CalculateSymbolContext (SymbolContext *sc)
if (m_owner_scope)
m_owner_scope->CalculateSymbolContext(sc);
else
- sc->Clear();
+ sc->Clear(false);
}
bool
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp
index 2cc46ef9b31..98249a4f5e2 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -250,7 +250,7 @@ void
StackFrame::ChangePC (addr_t pc)
{
m_frame_code_addr.SetRawAddress(pc);
- m_sc.Clear();
+ m_sc.Clear(false);
m_flags.Reset(0);
ThreadSP thread_sp (GetThread());
if (thread_sp)
OpenPOWER on IntegriCloud