From 8f698d552b91e7b8e9dd33ee3e506f582bafce72 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Sat, 19 Oct 2013 02:28:49 +0200 Subject: [PATCH] Handle it for step into too --- Windows/Debugger/Debugger_Disasm.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index adc6e6f6a8..1af1345e6a 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -163,10 +163,35 @@ void CDisasm::stepInto() CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW)); lastTicks = CoreTiming::GetTicks(); + u32 currentPc = cpu->GetPC(); + u32 windowEnd = ptr->getWindowEnd(); // If the current PC is on a breakpoint, the user doesn't want to do nothing. CBreakPoints::SetSkipFirst(currentMIPS->pc); + MIPSAnalyst::MipsOpcodeInfo info = MIPSAnalyst::GetOpcodeInfo(cpu,cpu->GetPC()); + if (info.isBranch) + { + u32 newAddress = currentPc+cpu->getInstructionSize(0); + if (newAddress == windowEnd-4) + ptr->scrollWindow(1); + else if (newAddress == windowEnd) + ptr->scrollWindow(2); + } else { + if (!currentMIPS->inDelaySlot) + { + MIPSAnalyst::MipsOpcodeInfo prevInfo = MIPSAnalyst::GetOpcodeInfo(cpu,cpu->GetPC()-cpu->getInstructionSize(0)); + if (!prevInfo.isBranch || (prevInfo.isConditional && !prevInfo.conditionMet)) + { + u32 newAddress = currentPc+cpu->getInstructionSize(0); + if (newAddress == windowEnd-4) + ptr->scrollWindow(1); + else if (newAddress == windowEnd) + ptr->scrollWindow(2); + } + } + } + Core_DoSingleStep(); Sleep(1); _dbg_update_();