diff --git a/Core/HLE/HLE.cpp b/Core/HLE/HLE.cpp index 517fb759ac..2e0a3710a3 100644 --- a/Core/HLE/HLE.cpp +++ b/Core/HLE/HLE.cpp @@ -371,18 +371,23 @@ void hleCoreTimingForceCheck() { } // Pauses execution after an HLE call. -bool hleExecuteDebugBreak(const HLEFunction &func) -{ +static bool hleExecuteDebugBreak(const HLEFunction *func) { + if (!func || coreState == CORE_RUNNING_GE) { + // Let's break on the next one. + return false; + } + const u32 NID_SUSPEND_INTR = 0x092968F4, NID_RESUME_INTR = 0x5F10D406; // Never break on these, they're noise. u32 blacklistedNIDs[] = {NID_SUSPEND_INTR, NID_RESUME_INTR, NID_IDLE}; for (size_t i = 0; i < ARRAY_SIZE(blacklistedNIDs); ++i) { - if (func.ID == blacklistedNIDs[i]) + if (func->ID == blacklistedNIDs[i]) return false; } + INFO_LOG(Log::CPU, "Broke after syscall: %s", func->name); Core_Break("hle.step", latestSyscallPC); return true; } @@ -624,9 +629,7 @@ static void hleFinishSyscall(const HLEFunction *info) { __KernelReSchedule(hleAfterSyscallReschedReason); if ((hleAfterSyscall & HLE_AFTER_DEBUG_BREAK) != 0) { - _dbg_assert_(info); - if (!hleExecuteDebugBreak(*info)) - { + if (!hleExecuteDebugBreak(info)) { // We'll do it next syscall. hleAfterSyscall = HLE_AFTER_DEBUG_BREAK; hleAfterSyscallReschedReason = 0; diff --git a/UI/ImDebugger/ImDebugger.cpp b/UI/ImDebugger/ImDebugger.cpp index e115c6643e..a317d17c51 100644 --- a/UI/ImDebugger/ImDebugger.cpp +++ b/UI/ImDebugger/ImDebugger.cpp @@ -1115,6 +1115,12 @@ void ImDisasmWindow::Draw(MIPSDebugInterface *mipsDebug, ImConfig &cfg, CoreStat Core_RequestCPUStep(CPUStepType::Frame, 0); } + ImGui::SameLine(); + if (ImGui::SmallButton("Syscall")) { + hleDebugBreak(); + Core_Resume(); + } + ImGui::SameLine(); ImGui::SmallButton("Skim"); if (ImGui::IsItemActive()) { diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index 46224da487..2711c990b1 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -405,8 +405,6 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) { } else { // go lastTicks_ = CoreTiming::GetTicks(); - // If the current PC is on a breakpoint, the user doesn't want to do nothing. - breakpoints_->SetSkipFirst(currentMIPS->pc); Core_Resume(); } } @@ -430,9 +428,6 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) { break; lastTicks_ = CoreTiming::GetTicks(); - // If the current PC is on a breakpoint, the user doesn't want to do nothing. - breakpoints_->SetSkipFirst(currentMIPS->pc); - hleDebugBreak(); Core_Resume(); }