| 473 | } |
| 474 | |
| 475 | ResultCode Debugger::ContinueExecution(DbgContinue_Action action, uint32_t breakpointMask, uint32_t flags) |
| 476 | { |
| 477 | if (breakpointMask & ~BreakpointTypeAll) { |
| 478 | Debug("Debugger::ContinueExecution(): Unsupported breakpoint type set: %08x", breakpointMask); |
| 479 | return ResultCode::UnsupportedBreakpointType; |
| 480 | } |
| 481 | |
| 482 | if (flags & ~ContinueFlagAll) { |
| 483 | Debug("Debugger::ContinueExecution(): Unsupported flag set: %08x", flags); |
| 484 | return ResultCode::UnsupportedContinueFlags; |
| 485 | } |
| 486 | |
| 487 | std::unique_lock<std::mutex> lk(breakpointMutex_); |
| 488 | |
| 489 | if (action == DbgContinue_Action_PAUSE) { |
| 490 | if (isPaused_) { |
| 491 | Debug("Debugger::ContinueExecution(): Already paused"); |
| 492 | return ResultCode::InPause; |
| 493 | } |
| 494 | |
| 495 | Debug("Debugger::ContinueExecution(): Force pause on next node"); |
| 496 | // Forcibly break on the next call |
| 497 | breakpoints_.SetForcedBreakpoints(true, breakpointMask, flags, 0x7fffffff); |
| 498 | // This is not a "continue" message, it just sets the breakpoint flags, |
| 499 | // so we don't go through the continue code here |
| 500 | return ResultCode::Success; |
| 501 | } |
| 502 | |
| 503 | if (!isPaused_) { |
| 504 | Debug("Debugger::ContinueExecution(): Not paused"); |
| 505 | return ResultCode::NotInPause; |
| 506 | } |
| 507 | |
| 508 | switch (action) { |
| 509 | case DbgContinue_Action_CONTINUE: |
| 510 | // No forced break on the next node |
| 511 | breakpoints_.SetForcedBreakpoints(false, breakpointMask, flags, 0); |
| 512 | break; |
| 513 | |
| 514 | case DbgContinue_Action_STEP_OVER: |
| 515 | // Step over the current frame; max depth is the current call stack depth |
| 516 | breakpoints_.SetForcedBreakpoints(true, breakpointMask, flags, (uint32_t)callStack_.size()); |
| 517 | break; |
| 518 | |
| 519 | case DbgContinue_Action_STEP_INTO: |
| 520 | // Step into the current frame; max depth is unlimited |
| 521 | breakpoints_.SetForcedBreakpoints(true, breakpointMask, flags, 0x7fffffff); |
| 522 | break; |
| 523 | |
| 524 | case DbgContinue_Action_STEP_OUT: |
| 525 | // Step out of the current frame; max depth is current - 1 |
| 526 | breakpoints_.SetForcedBreakpoints(true, breakpointMask, flags, (uint32_t)callStack_.size() - 1); |
| 527 | break; |
| 528 | |
| 529 | default: |
| 530 | Debug("Debugger::ContinueExecution(): Continue action %d not known", action); |
| 531 | return ResultCode::InvalidContinueAction; |
| 532 | } |
no test coverage detected