MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / onStepInto

Method onStepInto

pcsx2-qt/Debugger/DebuggerWindow.cpp:409–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409void 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
456void DebuggerWindow::onStepOver()
457{

Callers

nothing calls this directly

Calls 7

GetOpcodeInfoFunction · 0.85
isAliveMethod · 0.80
isCpuPausedMethod · 0.80
getCpuTypeMethod · 0.80
getPCMethod · 0.80
resumeCpuMethod · 0.80
updateFunction · 0.50

Tested by

no test coverage detected