Remove redundant code. Add "break after syscall" button, fix up

This commit is contained in:
Henrik Rydgård committed 2024-12-10 22:43:31 +01:00
1 parent 27122a9e64
commit 5817f60346
3 files changed
+15 -11

No files matched your search

+9 -6
View File
@@ -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;
+6
View File
@@ -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()) {
-5
View File
@@ -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();
}