Permalink
Browse files

Debugger: Track a counter when entering stepping.

This allows us to poll coreState and know if a new stepping needs to be
sent.  This is useful to allow e.g. regs to show changes per step.
  • Loading branch information...
unknownbrackets committed Apr 20, 2018
1 parent e9cc1ee commit 77609bbea280d2d079bf7bbca22546826c5e1f54
Showing with 8 additions and 2 deletions.
  1. +6 −0 Core/Core.cpp
  2. +2 −2 Core/Core.h
View
@@ -54,6 +54,7 @@ static std::mutex m_hStepMutex;
static std::condition_variable m_InactiveCond;
static std::mutex m_hInactiveMutex;
static bool singleStepPending = false;
static int steppingCounter = 0;
static std::set<Core_ShutdownFunc> shutdownFuncs;
static bool windowHidden = false;
static double lastActivity = 0.0;
@@ -334,10 +335,15 @@ void Core_EnableStepping(bool step) {
sleep_ms(1);
host->SetDebugMode(true);
Core_UpdateState(CORE_STEPPING);
steppingCounter++;
} else {
host->SetDebugMode(false);
coreState = CORE_RUNNING;
coreStatePending = false;
m_StepCond.notify_all();
}
}
int Core_GetSteppingCounter() {
return steppingCounter;
}
View
@@ -31,12 +31,12 @@ void Core_ErrorPause();
// For platforms that don't call Core_Run
void Core_SetGraphicsContext(GraphicsContext *ctx);
void Core_RunRenderThreadFrame();
// called from gui
void Core_EnableStepping(bool step);
void Core_DoSingleStep();
void Core_UpdateSingleStep();
// Changes every time we enter stepping.
int Core_GetSteppingCounter();
typedef void (* Core_ShutdownFunc)();
void Core_ListenShutdown(Core_ShutdownFunc func);

0 comments on commit 77609bb

Please sign in to comment.