Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- ThreadPlanStepUntil.cpp ---------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | //m_should_stop |
| 10 | |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "lldb/Target/ThreadPlanStepUntil.h" |
| 15 | |
| 16 | // C Includes |
| 17 | // C++ Includes |
| 18 | // Other libraries and framework includes |
| 19 | // Project includes |
| 20 | #include "lldb/Breakpoint/Breakpoint.h" |
| 21 | #include "lldb/lldb-private-log.h" |
| 22 | #include "lldb/Core/Log.h" |
| 23 | #include "lldb/Target/Process.h" |
| 24 | #include "lldb/Target/RegisterContext.h" |
Greg Clayton | 643ee73 | 2010-08-04 01:40:35 +0000 | [diff] [blame] | 25 | #include "lldb/Target/StopInfo.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 26 | #include "lldb/Target/Target.h" |
| 27 | |
| 28 | using namespace lldb; |
| 29 | using namespace lldb_private; |
| 30 | |
| 31 | //---------------------------------------------------------------------- |
| 32 | // ThreadPlanStepUntil: Run until we reach a given line number or step out of the current frame |
| 33 | //---------------------------------------------------------------------- |
| 34 | |
| 35 | ThreadPlanStepUntil::ThreadPlanStepUntil |
| 36 | ( |
| 37 | Thread &thread, |
| 38 | lldb::addr_t *address_list, |
| 39 | size_t num_addresses, |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 40 | bool stop_others, |
| 41 | uint32_t frame_idx |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 42 | ) : |
Jim Ingham | 5a47e8b | 2010-06-19 04:45:32 +0000 | [diff] [blame] | 43 | ThreadPlan (ThreadPlan::eKindStepUntil, "Step until", thread, eVoteNoOpinion, eVoteNoOpinion), |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 44 | m_step_from_insn (LLDB_INVALID_ADDRESS), |
Jim Ingham | 441e3b9 | 2012-03-01 00:50:50 +0000 | [diff] [blame] | 45 | m_return_bp_id (LLDB_INVALID_BREAK_ID), |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 46 | m_return_addr (LLDB_INVALID_ADDRESS), |
Jim Ingham | 441e3b9 | 2012-03-01 00:50:50 +0000 | [diff] [blame] | 47 | m_stepped_out (false), |
| 48 | m_should_stop (false), |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 49 | m_ran_analyze (false), |
Jim Ingham | 441e3b9 | 2012-03-01 00:50:50 +0000 | [diff] [blame] | 50 | m_explains_stop (false), |
| 51 | m_until_points (), |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 52 | m_stop_others (stop_others) |
| 53 | { |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 54 | // Stash away our "until" addresses: |
Greg Clayton | f4124de | 2012-02-21 00:09:25 +0000 | [diff] [blame] | 55 | TargetSP target_sp (m_thread.CalculateTarget()); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 56 | |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 57 | StackFrameSP frame_sp (m_thread.GetStackFrameAtIndex (frame_idx)); |
| 58 | if (frame_sp) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 59 | { |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 60 | m_step_from_insn = frame_sp->GetStackID().GetPC(); |
| 61 | lldb::user_id_t thread_id = m_thread.GetID(); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 62 | |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 63 | // Find the return address and set a breakpoint there: |
| 64 | // FIXME - can we do this more securely if we know first_insn? |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 65 | |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 66 | StackFrameSP return_frame_sp (m_thread.GetStackFrameAtIndex(frame_idx + 1)); |
| 67 | if (return_frame_sp) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 68 | { |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 69 | // TODO: add inline functionality |
| 70 | m_return_addr = return_frame_sp->GetStackID().GetPC(); |
Greg Clayton | f4124de | 2012-02-21 00:09:25 +0000 | [diff] [blame] | 71 | Breakpoint *return_bp = target_sp->CreateBreakpoint (m_return_addr, true).get(); |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 72 | if (return_bp != NULL) |
| 73 | { |
| 74 | return_bp->SetThreadID(thread_id); |
| 75 | m_return_bp_id = return_bp->GetID(); |
Jim Ingham | 090f831 | 2013-01-26 02:19:28 +0000 | [diff] [blame] | 76 | return_bp->SetBreakpointKind ("until-return-backstop"); |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 77 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 78 | } |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 79 | |
Jim Ingham | 441e3b9 | 2012-03-01 00:50:50 +0000 | [diff] [blame] | 80 | m_stack_id = m_thread.GetStackFrameAtIndex(frame_idx)->GetStackID(); |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 81 | |
| 82 | // Now set breakpoints on all our return addresses: |
| 83 | for (int i = 0; i < num_addresses; i++) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 84 | { |
Greg Clayton | f4124de | 2012-02-21 00:09:25 +0000 | [diff] [blame] | 85 | Breakpoint *until_bp = target_sp->CreateBreakpoint (address_list[i], true).get(); |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 86 | if (until_bp != NULL) |
| 87 | { |
| 88 | until_bp->SetThreadID(thread_id); |
| 89 | m_until_points[address_list[i]] = until_bp->GetID(); |
Jim Ingham | 090f831 | 2013-01-26 02:19:28 +0000 | [diff] [blame] | 90 | until_bp->SetBreakpointKind("until-target"); |
Greg Clayton | 1ebdcc7 | 2011-01-21 06:11:58 +0000 | [diff] [blame] | 91 | } |
| 92 | else |
| 93 | { |
| 94 | m_until_points[address_list[i]] = LLDB_INVALID_BREAK_ID; |
| 95 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | ThreadPlanStepUntil::~ThreadPlanStepUntil () |
| 101 | { |
| 102 | Clear(); |
| 103 | } |
| 104 | |
| 105 | void |
| 106 | ThreadPlanStepUntil::Clear() |
| 107 | { |
Greg Clayton | f4124de | 2012-02-21 00:09:25 +0000 | [diff] [blame] | 108 | TargetSP target_sp (m_thread.CalculateTarget()); |
| 109 | if (target_sp) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 110 | { |
Greg Clayton | f4124de | 2012-02-21 00:09:25 +0000 | [diff] [blame] | 111 | if (m_return_bp_id != LLDB_INVALID_BREAK_ID) |
| 112 | { |
| 113 | target_sp->RemoveBreakpointByID(m_return_bp_id); |
| 114 | m_return_bp_id = LLDB_INVALID_BREAK_ID; |
| 115 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 116 | |
Greg Clayton | f4124de | 2012-02-21 00:09:25 +0000 | [diff] [blame] | 117 | until_collection::iterator pos, end = m_until_points.end(); |
| 118 | for (pos = m_until_points.begin(); pos != end; pos++) |
| 119 | { |
| 120 | target_sp->RemoveBreakpointByID((*pos).second); |
| 121 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 122 | } |
| 123 | m_until_points.clear(); |
| 124 | } |
| 125 | |
| 126 | void |
| 127 | ThreadPlanStepUntil::GetDescription (Stream *s, lldb::DescriptionLevel level) |
| 128 | { |
| 129 | if (level == lldb::eDescriptionLevelBrief) |
| 130 | { |
| 131 | s->Printf ("step until"); |
| 132 | if (m_stepped_out) |
| 133 | s->Printf (" - stepped out"); |
| 134 | } |
| 135 | else |
| 136 | { |
| 137 | if (m_until_points.size() == 1) |
Daniel Malea | 5f35a4b | 2012-11-29 21:49:15 +0000 | [diff] [blame] | 138 | s->Printf ("Stepping from address 0x%" PRIx64 " until we reach 0x%" PRIx64 " using breakpoint %d", |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 139 | (uint64_t)m_step_from_insn, |
| 140 | (uint64_t) (*m_until_points.begin()).first, |
| 141 | (*m_until_points.begin()).second); |
| 142 | else |
| 143 | { |
| 144 | until_collection::iterator pos, end = m_until_points.end(); |
Daniel Malea | 5f35a4b | 2012-11-29 21:49:15 +0000 | [diff] [blame] | 145 | s->Printf ("Stepping from address 0x%" PRIx64 " until we reach one of:", |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 146 | (uint64_t)m_step_from_insn); |
| 147 | for (pos = m_until_points.begin(); pos != end; pos++) |
| 148 | { |
Daniel Malea | 5f35a4b | 2012-11-29 21:49:15 +0000 | [diff] [blame] | 149 | s->Printf ("\n\t0x%" PRIx64 " (bp: %d)", (uint64_t) (*pos).first, (*pos).second); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 150 | } |
| 151 | } |
Daniel Malea | 5f35a4b | 2012-11-29 21:49:15 +0000 | [diff] [blame] | 152 | s->Printf(" stepped out address is 0x%" PRIx64 ".", (uint64_t) m_return_addr); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 153 | } |
| 154 | } |
| 155 | |
| 156 | bool |
| 157 | ThreadPlanStepUntil::ValidatePlan (Stream *error) |
| 158 | { |
| 159 | if (m_return_bp_id == LLDB_INVALID_BREAK_ID) |
| 160 | return false; |
| 161 | else |
| 162 | { |
| 163 | until_collection::iterator pos, end = m_until_points.end(); |
| 164 | for (pos = m_until_points.begin(); pos != end; pos++) |
| 165 | { |
| 166 | if (!LLDB_BREAK_ID_IS_VALID ((*pos).second)) |
| 167 | return false; |
| 168 | } |
| 169 | return true; |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | void |
| 174 | ThreadPlanStepUntil::AnalyzeStop() |
| 175 | { |
| 176 | if (m_ran_analyze) |
| 177 | return; |
| 178 | |
Jim Ingham | 6297a3a | 2010-10-20 00:39:53 +0000 | [diff] [blame] | 179 | StopInfoSP stop_info_sp = GetPrivateStopReason(); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 180 | m_should_stop = true; |
| 181 | m_explains_stop = false; |
| 182 | |
Jim Ingham | 6297a3a | 2010-10-20 00:39:53 +0000 | [diff] [blame] | 183 | if (stop_info_sp) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 184 | { |
Jim Ingham | 6297a3a | 2010-10-20 00:39:53 +0000 | [diff] [blame] | 185 | StopReason reason = stop_info_sp->GetStopReason(); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 186 | |
| 187 | switch (reason) |
| 188 | { |
| 189 | case eStopReasonBreakpoint: |
| 190 | { |
| 191 | // If this is OUR breakpoint, we're fine, otherwise we don't know why this happened... |
Greg Clayton | f4124de | 2012-02-21 00:09:25 +0000 | [diff] [blame] | 192 | BreakpointSiteSP this_site = m_thread.GetProcess()->GetBreakpointSiteList().FindByID (stop_info_sp->GetValue()); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 193 | if (!this_site) |
| 194 | { |
| 195 | m_explains_stop = false; |
| 196 | return; |
| 197 | } |
| 198 | |
| 199 | if (this_site->IsBreakpointAtThisSite (m_return_bp_id)) |
| 200 | { |
| 201 | // If we are at our "step out" breakpoint, and the stack depth has shrunk, then |
| 202 | // this is indeed our stop. |
| 203 | // If the stack depth has grown, then we've hit our step out breakpoint recursively. |
| 204 | // If we are the only breakpoint at that location, then we do explain the stop, and |
| 205 | // we'll just continue. |
| 206 | // If there was another breakpoint here, then we don't explain the stop, but we won't |
| 207 | // mark ourselves Completed, because maybe that breakpoint will continue, and then |
| 208 | // we'll finish the "until". |
Jim Ingham | 441e3b9 | 2012-03-01 00:50:50 +0000 | [diff] [blame] | 209 | bool done; |
| 210 | StackID cur_frame_zero_id; |
| 211 | |
| 212 | if (m_stack_id < cur_frame_zero_id) |
| 213 | done = true; |
| 214 | else |
| 215 | done = false; |
| 216 | |
| 217 | if (done) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 218 | { |
| 219 | m_stepped_out = true; |
| 220 | SetPlanComplete(); |
| 221 | } |
| 222 | else |
| 223 | m_should_stop = false; |
| 224 | |
| 225 | if (this_site->GetNumberOfOwners() == 1) |
| 226 | m_explains_stop = true; |
| 227 | else |
| 228 | m_explains_stop = false; |
| 229 | return; |
| 230 | } |
| 231 | else |
| 232 | { |
| 233 | // Check if we've hit one of our "until" breakpoints. |
| 234 | until_collection::iterator pos, end = m_until_points.end(); |
| 235 | for (pos = m_until_points.begin(); pos != end; pos++) |
| 236 | { |
| 237 | if (this_site->IsBreakpointAtThisSite ((*pos).second)) |
| 238 | { |
| 239 | // If we're at the right stack depth, then we're done. |
Jim Ingham | 441e3b9 | 2012-03-01 00:50:50 +0000 | [diff] [blame] | 240 | |
| 241 | bool done; |
| 242 | StackID frame_zero_id = m_thread.GetStackFrameAtIndex(0)->GetStackID(); |
| 243 | |
| 244 | if (frame_zero_id == m_stack_id) |
| 245 | done = true; |
| 246 | else if (frame_zero_id < m_stack_id) |
| 247 | done = false; |
| 248 | else |
| 249 | { |
| 250 | StackFrameSP older_frame_sp = m_thread.GetStackFrameAtIndex(1); |
| 251 | |
| 252 | // But if we can't even unwind one frame we should just get out of here & stop... |
| 253 | if (older_frame_sp) |
| 254 | { |
| 255 | const SymbolContext &older_context |
| 256 | = older_frame_sp->GetSymbolContext(eSymbolContextEverything); |
| 257 | SymbolContext stack_context; |
| 258 | m_stack_id.GetSymbolContextScope()->CalculateSymbolContext(&stack_context); |
| 259 | |
| 260 | if (older_context == stack_context) |
| 261 | done = true; |
| 262 | else |
| 263 | done = false; |
| 264 | } |
| 265 | else |
| 266 | done = false; |
| 267 | } |
| 268 | |
| 269 | if (done) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 270 | SetPlanComplete(); |
| 271 | else |
| 272 | m_should_stop = false; |
| 273 | |
| 274 | // Otherwise we've hit this breakpoint recursively. If we're the |
| 275 | // only breakpoint here, then we do explain the stop, and we'll continue. |
| 276 | // If not then we should let higher plans handle this stop. |
| 277 | if (this_site->GetNumberOfOwners() == 1) |
| 278 | m_explains_stop = true; |
| 279 | else |
| 280 | { |
| 281 | m_should_stop = true; |
| 282 | m_explains_stop = false; |
| 283 | } |
| 284 | return; |
| 285 | } |
| 286 | } |
| 287 | } |
| 288 | // If we get here we haven't hit any of our breakpoints, so let the higher |
| 289 | // plans take care of the stop. |
| 290 | m_explains_stop = false; |
| 291 | return; |
| 292 | } |
| 293 | case eStopReasonWatchpoint: |
| 294 | case eStopReasonSignal: |
| 295 | case eStopReasonException: |
Greg Clayton | 0bce9a2 | 2012-12-05 00:16:59 +0000 | [diff] [blame] | 296 | case eStopReasonExec: |
Andrew Kaylor | 278f16e | 2012-12-20 23:08:03 +0000 | [diff] [blame] | 297 | case eStopReasonThreadExiting: |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 298 | m_explains_stop = false; |
| 299 | break; |
| 300 | default: |
| 301 | m_explains_stop = true; |
| 302 | break; |
| 303 | } |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | bool |
Jim Ingham | 89e248f | 2013-02-09 01:29:05 +0000 | [diff] [blame] | 308 | ThreadPlanStepUntil::PlanExplainsStop (Event *event_ptr) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 309 | { |
| 310 | // We don't explain signals or breakpoints (breakpoints that handle stepping in or |
| 311 | // out will be handled by a child plan. |
| 312 | AnalyzeStop(); |
| 313 | return m_explains_stop; |
| 314 | } |
| 315 | |
| 316 | bool |
| 317 | ThreadPlanStepUntil::ShouldStop (Event *event_ptr) |
| 318 | { |
| 319 | // If we've told our self in ExplainsStop that we plan to continue, then |
| 320 | // do so here. Otherwise, as long as this thread has stopped for a reason, |
| 321 | // we will stop. |
| 322 | |
Jim Ingham | 6297a3a | 2010-10-20 00:39:53 +0000 | [diff] [blame] | 323 | StopInfoSP stop_info_sp = GetPrivateStopReason(); |
Sean Callanan | b386d82 | 2012-08-09 00:50:26 +0000 | [diff] [blame] | 324 | if (!stop_info_sp || stop_info_sp->GetStopReason() == eStopReasonNone) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 325 | return false; |
| 326 | |
| 327 | AnalyzeStop(); |
| 328 | return m_should_stop; |
| 329 | } |
| 330 | |
| 331 | bool |
| 332 | ThreadPlanStepUntil::StopOthers () |
| 333 | { |
| 334 | return m_stop_others; |
| 335 | } |
| 336 | |
| 337 | StateType |
Jim Ingham | 745ac7a | 2010-11-11 19:26:09 +0000 | [diff] [blame] | 338 | ThreadPlanStepUntil::GetPlanRunState () |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 339 | { |
| 340 | return eStateRunning; |
| 341 | } |
| 342 | |
| 343 | bool |
| 344 | ThreadPlanStepUntil::WillResume (StateType resume_state, bool current_plan) |
| 345 | { |
| 346 | ThreadPlan::WillResume (resume_state, current_plan); |
| 347 | if (current_plan) |
| 348 | { |
Greg Clayton | f4124de | 2012-02-21 00:09:25 +0000 | [diff] [blame] | 349 | TargetSP target_sp (m_thread.CalculateTarget()); |
| 350 | if (target_sp) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 351 | { |
Greg Clayton | f4124de | 2012-02-21 00:09:25 +0000 | [diff] [blame] | 352 | Breakpoint *return_bp = target_sp->GetBreakpointByID(m_return_bp_id).get(); |
| 353 | if (return_bp != NULL) |
| 354 | return_bp->SetEnabled (true); |
| 355 | |
| 356 | until_collection::iterator pos, end = m_until_points.end(); |
| 357 | for (pos = m_until_points.begin(); pos != end; pos++) |
| 358 | { |
| 359 | Breakpoint *until_bp = target_sp->GetBreakpointByID((*pos).second).get(); |
| 360 | if (until_bp != NULL) |
| 361 | until_bp->SetEnabled (true); |
| 362 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 363 | } |
| 364 | } |
| 365 | |
| 366 | m_should_stop = true; |
| 367 | m_ran_analyze = false; |
| 368 | m_explains_stop = false; |
| 369 | return true; |
| 370 | } |
| 371 | |
| 372 | bool |
| 373 | ThreadPlanStepUntil::WillStop () |
| 374 | { |
Greg Clayton | f4124de | 2012-02-21 00:09:25 +0000 | [diff] [blame] | 375 | TargetSP target_sp (m_thread.CalculateTarget()); |
| 376 | if (target_sp) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 377 | { |
Greg Clayton | f4124de | 2012-02-21 00:09:25 +0000 | [diff] [blame] | 378 | Breakpoint *return_bp = target_sp->GetBreakpointByID(m_return_bp_id).get(); |
| 379 | if (return_bp != NULL) |
| 380 | return_bp->SetEnabled (false); |
| 381 | |
| 382 | until_collection::iterator pos, end = m_until_points.end(); |
| 383 | for (pos = m_until_points.begin(); pos != end; pos++) |
| 384 | { |
| 385 | Breakpoint *until_bp = target_sp->GetBreakpointByID((*pos).second).get(); |
| 386 | if (until_bp != NULL) |
| 387 | until_bp->SetEnabled (false); |
| 388 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 389 | } |
| 390 | return true; |
| 391 | } |
| 392 | |
| 393 | bool |
| 394 | ThreadPlanStepUntil::MischiefManaged () |
| 395 | { |
| 396 | |
| 397 | // I'm letting "PlanExplainsStop" do all the work, and just reporting that here. |
| 398 | bool done = false; |
| 399 | if (IsPlanComplete()) |
| 400 | { |
Greg Clayton | 952e9dc | 2013-03-27 23:08:40 +0000 | [diff] [blame] | 401 | Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 402 | if (log) |
| 403 | log->Printf("Completed step until plan."); |
| 404 | |
| 405 | Clear(); |
| 406 | done = true; |
| 407 | } |
| 408 | if (done) |
| 409 | ThreadPlan::MischiefManaged (); |
| 410 | |
| 411 | return done; |
| 412 | |
| 413 | } |
| 414 | |