diff options
| author | Jim Ingham <jingham@apple.com> | 2014-03-12 22:03:13 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2014-03-12 22:03:13 +0000 |
| commit | 157831313d4a044fe5f36ee8d9a5ca508657134a (patch) | |
| tree | 1ec1135c8beba46b7d3a53b29ff266e25a5457f4 | |
| parent | ec49f9820c10ad889a2e880625abd4b56483d777 (diff) | |
| download | bcm5719-llvm-157831313d4a044fe5f36ee8d9a5ca508657134a.tar.gz bcm5719-llvm-157831313d4a044fe5f36ee8d9a5ca508657134a.zip | |
When clearing a breakpoint site, make sure the owning process still exists before asking it to remove the breakpoint site the rest of the way.
<rdar://problem/16303500>
llvm-svn: 203724
| -rw-r--r-- | lldb/include/lldb/Breakpoint/BreakpointSite.h | 1 | ||||
| -rw-r--r-- | lldb/source/Breakpoint/BreakpointLocation.cpp | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lldb/include/lldb/Breakpoint/BreakpointSite.h b/lldb/include/lldb/Breakpoint/BreakpointSite.h index 271a23c2e45..6292b307fc9 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointSite.h +++ b/lldb/include/lldb/Breakpoint/BreakpointSite.h @@ -257,6 +257,7 @@ public: private: friend class Process; + friend class BreakpointLocation; //------------------------------------------------------------------ /// The method removes the owner at \a break_loc_id from this breakpoint list. diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp index d058eac5a3f..fac0dcf05f3 100644 --- a/lldb/source/Breakpoint/BreakpointLocation.cpp +++ b/lldb/source/Breakpoint/BreakpointLocation.cpp @@ -521,8 +521,15 @@ BreakpointLocation::ClearBreakpointSite () { if (m_bp_site_sp.get()) { - m_owner.GetTarget().GetProcessSP()->RemoveOwnerFromBreakpointSite (GetBreakpoint().GetID(), + ProcessSP process_sp(m_owner.GetTarget().GetProcessSP()); + // If the process exists, get it to remove the owner, it will remove the physical implementation + // of the breakpoint as well if there are no more owners. Otherwise just remove this owner. + if (process_sp) + process_sp->RemoveOwnerFromBreakpointSite (GetBreakpoint().GetID(), GetID(), m_bp_site_sp); + else + m_bp_site_sp->RemoveOwner(GetBreakpoint().GetID(), GetID()); + m_bp_site_sp.reset(); return true; } |

