From db2eddcf274efc7b1aa1f8687f575cdf4648efbf Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 12 Dec 2021 11:18:18 -0800 Subject: [PATCH] Debugger: Remove double debug window updates. Core_EnableStepping() is already marking the debug windows for update, there's no need to call SetDebugMode() again. --- Core/Core.cpp | 4 ---- Core/Debugger/Breakpoints.cpp | 4 ---- Core/HLE/HLE.cpp | 1 - Core/MIPS/x86/CompBranch.cpp | 2 +- Windows/Debugger/Debugger_Disasm.cpp | 10 ---------- 5 files changed, 1 insertion(+), 20 deletions(-) diff --git a/Core/Core.cpp b/Core/Core.cpp index 1a469a0ca0..23f3e7eedd 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -447,7 +447,6 @@ void Core_MemoryException(u32 address, u32 pc, MemoryExceptionType type) { e.address = address; e.pc = pc; Core_EnableStepping(true, "memory.exception", address); - host->SetDebugMode(true); } } @@ -469,7 +468,6 @@ void Core_MemoryExceptionInfo(u32 address, u32 pc, MemoryExceptionType type, std e.address = address; e.pc = pc; Core_EnableStepping(true, "memory.exception", address); - host->SetDebugMode(true); } } @@ -485,7 +483,6 @@ void Core_ExecException(u32 address, u32 pc, ExecExceptionType type) { e.address = address; e.pc = pc; Core_EnableStepping(true, "cpu.exception", pc); - host->SetDebugMode(true); } void Core_Break() { @@ -498,7 +495,6 @@ void Core_Break() { if (!g_Config.bIgnoreBadMemAccess) { Core_EnableStepping(true, "cpu.breakInstruction", currentMIPS->pc); - host->SetDebugMode(true); } } diff --git a/Core/Debugger/Breakpoints.cpp b/Core/Debugger/Breakpoints.cpp index 29adc36145..5baa9dd96d 100644 --- a/Core/Debugger/Breakpoints.cpp +++ b/Core/Debugger/Breakpoints.cpp @@ -69,7 +69,6 @@ BreakAction MemCheck::Action(u32 addr, bool write, int size, u32 pc, const char Log(addr, write, size, pc, reason); if ((result & BREAK_ACTION_PAUSE) && coreState != CORE_POWERUP) { Core_EnableStepping(true, "memory.breakpoint", start); - host->SetDebugMode(true); } return result; @@ -125,8 +124,6 @@ void MemCheck::JitCleanup(bool changed) CBreakPoints::SetSkipFirst(lastPC); Core_EnableStepping(false); } - else - host->SetDebugMode(true); } // Note: must lock while calling this. @@ -368,7 +365,6 @@ BreakAction CBreakPoints::ExecBreakPoint(u32 addr) { } if ((info.result & BREAK_ACTION_PAUSE) && coreState != CORE_POWERUP) { Core_EnableStepping(true, "cpu.breakpoint", info.addr); - host->SetDebugMode(true); } return info.result; diff --git a/Core/HLE/HLE.cpp b/Core/HLE/HLE.cpp index 1c0957e20d..7365620acb 100644 --- a/Core/HLE/HLE.cpp +++ b/Core/HLE/HLE.cpp @@ -364,7 +364,6 @@ bool hleExecuteDebugBreak(const HLEFunction &func) } Core_EnableStepping(true, "hle.step", latestSyscallPC); - host->SetDebugMode(true); return true; } diff --git a/Core/MIPS/x86/CompBranch.cpp b/Core/MIPS/x86/CompBranch.cpp index b3ec6588af..835768bf96 100644 --- a/Core/MIPS/x86/CompBranch.cpp +++ b/Core/MIPS/x86/CompBranch.cpp @@ -110,7 +110,7 @@ static void JitBranchLogMismatch(MIPSOpcode op, u32 pc) char temp[256]; MIPSDisAsm(op, pc, temp, true); ERROR_LOG(JIT, "Bad jump: %s - int:%08x jit:%08x", temp, currentMIPS->intBranchExit, currentMIPS->jitBranchExit); - host->SetDebugMode(true); + Core_EnableStepping(true, "jit.branchdebug", pc); } void Jit::BranchLog(MIPSOpcode op) diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index 9a31bd173b..1af3244022 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -286,7 +286,6 @@ void CDisasm::stepOver() ptr->scrollStepping(breakpointAddress); } - SetDebugMode(false, true); CBreakPoints::AddBreakPoint(breakpointAddress,true); Core_EnableStepping(false); Sleep(1); @@ -324,7 +323,6 @@ void CDisasm::stepOut() CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW)); ptr->setDontRedraw(true); - SetDebugMode(false, true); CBreakPoints::AddBreakPoint(breakpointAddress,true); Core_EnableStepping(false); Sleep(1); @@ -343,7 +341,6 @@ void CDisasm::runToLine() lastTicks = CoreTiming::GetTicks(); ptr->setDontRedraw(true); - SetDebugMode(false, true); CBreakPoints::AddBreakPoint(pos,true); Core_EnableStepping(false); } @@ -420,7 +417,6 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) bool isRunning = Core_IsActive(); if (isRunning) { - SetDebugMode(true, false); Core_EnableStepping(true, "cpu.breakpoint.add", 0); Core_WaitInactive(200); } @@ -429,10 +425,7 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) if (bpw.exec()) bpw.addBreakpoint(); if (isRunning) - { - SetDebugMode(false, false); Core_EnableStepping(false); - } keepStatusBarText = false; } break; @@ -524,7 +517,6 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) if (!Core_IsStepping()) // stop { ptr->setDontRedraw(false); - SetDebugMode(true, true); Core_EnableStepping(true, "ui.break", 0); Sleep(1); //let cpu catch up ptr->gotoPC(); @@ -537,7 +529,6 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) // If the current PC is on a breakpoint, the user doesn't want to do nothing. CBreakPoints::SetSkipFirst(currentMIPS->pc); - SetDebugMode(false, true); Core_EnableStepping(false); } } @@ -565,7 +556,6 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) CBreakPoints::SetSkipFirst(currentMIPS->pc); hleDebugBreak(); - SetDebugMode(false, true); Core_EnableStepping(false); } break;