mirror of
https://github.com/SourMesen/Mesen2.git
synced 2025-04-02 10:21:44 -04:00
Debugger: Fixed debugger not always pausing correctly when opened
This commit is contained in:
parent
ba0b5a89a5
commit
e075347ec3
5 changed files with 9 additions and 6 deletions
|
@ -99,9 +99,6 @@ Debugger::Debugger(Emulator* emu, IConsole* console)
|
|||
|
||||
RefreshCodeCache();
|
||||
|
||||
if(_emu->IsPaused()) {
|
||||
Step(_mainCpuType, 1, StepType::Step);
|
||||
}
|
||||
_executionStopped = false;
|
||||
}
|
||||
|
||||
|
@ -397,6 +394,11 @@ void Debugger::Step(CpuType cpuType, int32_t stepCount, StepType type)
|
|||
_waitForBreakResume = false;
|
||||
}
|
||||
|
||||
bool Debugger::IsPaused()
|
||||
{
|
||||
return _waitForBreakResume;
|
||||
}
|
||||
|
||||
bool Debugger::IsExecutionStopped()
|
||||
{
|
||||
return _executionStopped || _emu->IsThreadPaused();
|
||||
|
|
|
@ -106,6 +106,7 @@ public:
|
|||
|
||||
void Run();
|
||||
void Step(CpuType cpuType, int32_t stepCount, StepType type);
|
||||
bool IsPaused();
|
||||
bool IsExecutionStopped();
|
||||
|
||||
bool HasBreakRequest();
|
||||
|
|
|
@ -661,7 +661,7 @@ bool Emulator::IsPaused()
|
|||
{
|
||||
shared_ptr<Debugger> debugger = _debugger.lock();
|
||||
if(debugger) {
|
||||
return debugger->IsExecutionStopped();
|
||||
return debugger->IsPaused();
|
||||
} else {
|
||||
return _paused;
|
||||
}
|
||||
|
|
|
@ -536,7 +536,7 @@ namespace Mesen.Debugger.ViewModels
|
|||
};
|
||||
}
|
||||
|
||||
private void Step(StepType type, int instructionCount = 1)
|
||||
public void Step(StepType type, int instructionCount = 1)
|
||||
{
|
||||
switch(type) {
|
||||
case StepType.PpuStep:
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace Mesen.Debugger.Windows
|
|||
ScrollToAddress((uint)_scrollToAddress);
|
||||
} else if(_model.Config.BreakOnOpen) {
|
||||
if(!EmuApi.IsPaused()) {
|
||||
EmuApi.Pause();
|
||||
_model.Step(StepType.Step);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue