summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanStepThrough.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-02-21 00:09:25 +0000
committerGreg Clayton <gclayton@apple.com>2012-02-21 00:09:25 +0000
commit1ac04c308832f7a9b2e07e360f07c82f7cb2a02c (patch)
treebb908a56f1d08a946f4f25aa7b4b762066e1ec57 /lldb/source/Target/ThreadPlanStepThrough.cpp
parent3508a0054301ef24b8d8619351788698bcd97620 (diff)
downloadbcm5719-llvm-1ac04c308832f7a9b2e07e360f07c82f7cb2a02c.tar.gz
bcm5719-llvm-1ac04c308832f7a9b2e07e360f07c82f7cb2a02c.zip
Thread hardening part 3. Now lldb_private::Thread objects have std::weak_ptr
objects for the backlink to the lldb_private::Process. The issues we were running into before was someone was holding onto a shared pointer to a lldb_private::Thread for too long, and the lldb_private::Process parent object would get destroyed and the lldb_private::Thread had a "Process &m_process" member which would just treat whatever memory that used to be a Process as a valid Process. This was mostly happening for lldb_private::StackFrame objects that had a member like "Thread &m_thread". So this completes the internal strong/weak changes. Documented the ExecutionContext and ExecutionContextRef classes so that our LLDB developers can understand when and where to use ExecutionContext and ExecutionContextRef objects. llvm-svn: 151009
Diffstat (limited to 'lldb/source/Target/ThreadPlanStepThrough.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanStepThrough.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lldb/source/Target/ThreadPlanStepThrough.cpp b/lldb/source/Target/ThreadPlanStepThrough.cpp
index 606cfd190ef..cb7bf99711a 100644
--- a/lldb/source/Target/ThreadPlanStepThrough.cpp
+++ b/lldb/source/Target/ThreadPlanStepThrough.cpp
@@ -56,8 +56,8 @@ ThreadPlanStepThrough::ThreadPlanStepThrough (Thread &thread, bool stop_others)
if (return_frame_sp)
{
- m_backstop_addr = return_frame_sp->GetFrameCodeAddress().GetLoadAddress(&m_thread.GetProcess().GetTarget());
- Breakpoint *return_bp = m_thread.GetProcess().GetTarget().CreateBreakpoint (m_backstop_addr, true).get();
+ m_backstop_addr = return_frame_sp->GetFrameCodeAddress().GetLoadAddress(m_thread.CalculateTarget().get());
+ Breakpoint *return_bp = m_thread.GetProcess()->GetTarget().CreateBreakpoint (m_backstop_addr, true).get();
if (return_bp != NULL)
{
return_bp->SetThreadID(m_thread.GetID());
@@ -76,7 +76,7 @@ ThreadPlanStepThrough::~ThreadPlanStepThrough ()
{
if (m_backstop_bkpt_id != LLDB_INVALID_BREAK_ID)
{
- m_thread.GetProcess().GetTarget().RemoveBreakpointByID (m_backstop_bkpt_id);
+ m_thread.GetProcess()->GetTarget().RemoveBreakpointByID (m_backstop_bkpt_id);
m_backstop_bkpt_id = LLDB_INVALID_BREAK_ID;
}
}
@@ -91,11 +91,11 @@ ThreadPlanStepThrough::DidPush ()
void
ThreadPlanStepThrough::LookForPlanToStepThroughFromCurrentPC()
{
- m_sub_plan_sp = m_thread.GetProcess().GetDynamicLoader()->GetStepThroughTrampolinePlan (m_thread, m_stop_others);
+ m_sub_plan_sp = m_thread.GetProcess()->GetDynamicLoader()->GetStepThroughTrampolinePlan (m_thread, m_stop_others);
// If that didn't come up with anything, try the ObjC runtime plugin:
if (!m_sub_plan_sp.get())
{
- ObjCLanguageRuntime *objc_runtime = m_thread.GetProcess().GetObjCLanguageRuntime();
+ ObjCLanguageRuntime *objc_runtime = m_thread.GetProcess()->GetObjCLanguageRuntime();
if (objc_runtime)
m_sub_plan_sp = objc_runtime->GetStepThroughTrampolinePlan (m_thread, m_stop_others);
}
@@ -244,7 +244,7 @@ ThreadPlanStepThrough::MischiefManaged ()
ThreadPlan::MischiefManaged ();
if (m_backstop_bkpt_id != LLDB_INVALID_BREAK_ID)
{
- m_thread.GetProcess().GetTarget().RemoveBreakpointByID (m_backstop_bkpt_id);
+ m_thread.GetProcess()->GetTarget().RemoveBreakpointByID (m_backstop_bkpt_id);
m_backstop_bkpt_id = LLDB_INVALID_BREAK_ID;
}
return true;
@@ -258,7 +258,7 @@ ThreadPlanStepThrough::HitOurBackstopBreakpoint()
if (stop_info_sp && stop_info_sp->GetStopReason() == eStopReasonBreakpoint)
{
break_id_t stop_value = (break_id_t) stop_info_sp->GetValue();
- BreakpointSiteSP cur_site_sp = m_thread.GetProcess().GetBreakpointSiteList().FindByID(stop_value);
+ BreakpointSiteSP cur_site_sp = m_thread.GetProcess()->GetBreakpointSiteList().FindByID(stop_value);
if (cur_site_sp && cur_site_sp->IsBreakpointAtThisSite(m_backstop_bkpt_id))
{
size_t current_stack_depth = m_thread.GetStackFrameCount();
OpenPOWER on IntegriCloud