| 504 | } |
| 505 | |
| 506 | void DebuggerWindow::onStepOut() |
| 507 | { |
| 508 | DebugInterface* cpu = currentCPU(); |
| 509 | if (!cpu) |
| 510 | return; |
| 511 | |
| 512 | if (!cpu->isAlive() || !cpu->isCpuPaused()) |
| 513 | return; |
| 514 | |
| 515 | // Allow the cpu to skip this pc if it is a breakpoint |
| 516 | CBreakPoints::SetSkipFirst(cpu->getCpuType(), cpu->getPC()); |
| 517 | |
| 518 | std::vector<MipsStackWalk::StackFrame> stack_frames; |
| 519 | for (const auto& thread : cpu->GetThreadList()) |
| 520 | { |
| 521 | if (thread->Status() == ThreadStatus::THS_RUN) |
| 522 | { |
| 523 | stack_frames = MipsStackWalk::Walk( |
| 524 | cpu, |
| 525 | cpu->getPC(), |
| 526 | cpu->getRegister(0, 31), |
| 527 | cpu->getRegister(0, 29), |
| 528 | thread->EntryPoint()); |
| 529 | break; |
| 530 | } |
| 531 | } |
| 532 | |
| 533 | if (stack_frames.size() < 2) |
| 534 | return; |
| 535 | |
| 536 | u32 breakpoint_pc = stack_frames.at(1).pc; |
| 537 | |
| 538 | Host::RunOnCPUThread([cpu, breakpoint_pc] { |
| 539 | CBreakPoints::AddBreakPoint(cpu->getCpuType(), breakpoint_pc, true, true, true); |
| 540 | cpu->resumeCpu(); |
| 541 | }); |
| 542 | |
| 543 | update(); |
| 544 | } |
| 545 | |
| 546 | void DebuggerWindow::changeEvent(QEvent* event) |
| 547 | { |
nothing calls this directly
no test coverage detected