The second part in thread hardening the internals of LLDB where we make
the lldb_private::StackFrame objects hold onto a weak pointer to the thread
object. The lldb_private::StackFrame objects the the most volatile objects
we have as when we are doing single stepping, frames can often get lost or
thrown away, only to be re-created as another object that still refers to the
same frame. We have another bug tracking that. But we need to be able to
have frames no longer be able to get the thread when they are not part of
a thread anymore, and this is the first step (this fix makes that possible
but doesn't implement it yet).
Also changed lldb_private::ExecutionContextScope to return shared pointers to
all objects in the execution context to further thread harden the internals.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150871 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionParser.cpp b/source/Expression/ClangExpressionParser.cpp
index 958d18b..3a8c697 100644
--- a/source/Expression/ClangExpressionParser.cpp
+++ b/source/Expression/ClangExpressionParser.cpp
@@ -224,15 +224,15 @@
break;
}
- Process *process = NULL;
+ lldb::ProcessSP process_sp;
if (exe_scope)
- process = exe_scope->CalculateProcess();
+ process_sp = exe_scope->CalculateProcess();
- if (process && m_compiler->getLangOpts().ObjC1)
+ if (process_sp && m_compiler->getLangOpts().ObjC1)
{
- if (process->GetObjCLanguageRuntime())
+ if (process_sp->GetObjCLanguageRuntime())
{
- if (process->GetObjCLanguageRuntime()->GetRuntimeVersion() == eAppleObjC_V2)
+ if (process_sp->GetObjCLanguageRuntime()->GetRuntimeVersion() == eAppleObjC_V2)
{
m_compiler->getLangOpts().ObjCNonFragileABI = true; // NOT i386
m_compiler->getLangOpts().ObjCNonFragileABI2 = true; // NOT i386
@@ -256,18 +256,18 @@
m_compiler->getDiagnosticOpts().Warnings.push_back("no-unused-value");
// Set the target triple.
- Target *target = NULL;
+ lldb::TargetSP target_sp;
if (exe_scope)
- target = exe_scope->CalculateTarget();
+ target_sp = exe_scope->CalculateTarget();
// TODO: figure out what to really do when we don't have a valid target.
// Sometimes this will be ok to just use the host target triple (when we
// evaluate say "2+3", but other expressions like breakpoint conditions
// and other things that _are_ target specific really shouldn't just be
// using the host triple. This needs to be fixed in a better way.
- if (target && target->GetArchitecture().IsValid())
+ if (target_sp && target_sp->GetArchitecture().IsValid())
{
- std::string triple = target->GetArchitecture().GetTriple().str();
+ std::string triple = target_sp->GetArchitecture().GetTriple().str();
int dash_count = 0;
for (size_t i = 0; i < triple.size(); ++i)