| 407 | } |
| 408 | |
| 409 | void DebuggerWindow::onStepInto() |
| 410 | { |
| 411 | DebugInterface* cpu = currentCPU(); |
| 412 | if (!cpu) |
| 413 | return; |
| 414 | |
| 415 | if (!cpu->isAlive() || !cpu->isCpuPaused()) |
| 416 | return; |
| 417 | |
| 418 | // Allow the cpu to skip this pc if it is a breakpoint |
| 419 | CBreakPoints::SetSkipFirst(cpu->getCpuType(), cpu->getPC()); |
| 420 | |
| 421 | const u32 pc = cpu->getPC(); |
| 422 | const MIPSAnalyst::MipsOpcodeInfo info = MIPSAnalyst::GetOpcodeInfo(cpu, pc); |
| 423 | |
| 424 | u32 bpAddr = pc + 0x4; // Default to the next instruction |
| 425 | |
| 426 | if (info.isBranch) |
| 427 | { |
| 428 | if (!info.isConditional) |
| 429 | { |
| 430 | bpAddr = info.branchTarget; |
| 431 | } |
| 432 | else |
| 433 | { |
| 434 | if (info.conditionMet) |
| 435 | { |
| 436 | bpAddr = info.branchTarget; |
| 437 | } |
| 438 | else |
| 439 | { |
| 440 | bpAddr = pc + (2 * 4); // Skip branch delay slot |
| 441 | } |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | if (info.isSyscall) |
| 446 | bpAddr = info.branchTarget; // Syscalls are always taken |
| 447 | |
| 448 | Host::RunOnCPUThread([cpu, bpAddr] { |
| 449 | CBreakPoints::AddBreakPoint(cpu->getCpuType(), bpAddr, true, true, true); |
| 450 | cpu->resumeCpu(); |
| 451 | }); |
| 452 | |
| 453 | update(); |
| 454 | } |
| 455 | |
| 456 | void DebuggerWindow::onStepOver() |
| 457 | { |
nothing calls this directly
no test coverage detected