mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
GE Debugger: Track last gstate on stepping.
This commit is contained in:
1 parent
b654ee9d44
commit
71e855a822
2 files changed
+29
-10
No files matched your search
+26
-10
@@ -65,6 +65,8 @@ static GPUDebugBuffer bufferClut;
|
||||
static int bufferLevel;
|
||||
static u32 pauseSetCmdValue;
|
||||
|
||||
static GPUgstate lastGState;
|
||||
|
||||
static void SetPauseAction(PauseAction act, bool waitComplete = true) {
|
||||
pauseLock.lock();
|
||||
std::unique_lock<std::mutex> guard(actionLock);
|
||||
@@ -133,6 +135,22 @@ static void RunPauseAction() {
|
||||
pauseAction = PAUSE_BREAK;
|
||||
}
|
||||
|
||||
static void StartStepping() {
|
||||
if (lastGState.cmdmem[1] == 0) {
|
||||
lastGState = gstate;
|
||||
// Play it safe so we don't keep resetting.
|
||||
lastGState.cmdmem[1] |= 0x01000000;
|
||||
}
|
||||
gpuDebug->NotifySteppingEnter();
|
||||
isStepping = true;
|
||||
}
|
||||
|
||||
static void StopStepping() {
|
||||
gpuDebug->NotifySteppingExit();
|
||||
lastGState = gstate;
|
||||
isStepping = false;
|
||||
}
|
||||
|
||||
bool SingleStep() {
|
||||
std::unique_lock<std::mutex> guard(pauseLock);
|
||||
if (coreState != CORE_RUNNING && coreState != CORE_NEXTFRAME && coreState != CORE_STEPPING) {
|
||||
@@ -147,13 +165,9 @@ bool SingleStep() {
|
||||
return false;
|
||||
}
|
||||
|
||||
gpuDebug->NotifySteppingEnter();
|
||||
isStepping = true;
|
||||
|
||||
StartStepping();
|
||||
RunPauseAction();
|
||||
|
||||
gpuDebug->NotifySteppingExit();
|
||||
isStepping = false;
|
||||
StopStepping();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -171,13 +185,12 @@ bool EnterStepping() {
|
||||
return false;
|
||||
}
|
||||
|
||||
gpuDebug->NotifySteppingEnter();
|
||||
StartStepping();
|
||||
|
||||
// Just to be sure.
|
||||
if (pauseAction == PAUSE_CONTINUE) {
|
||||
pauseAction = PAUSE_BREAK;
|
||||
}
|
||||
isStepping = true;
|
||||
stepCounter++;
|
||||
|
||||
do {
|
||||
@@ -185,8 +198,7 @@ bool EnterStepping() {
|
||||
pauseWait.wait(guard);
|
||||
} while (pauseAction != PAUSE_CONTINUE);
|
||||
|
||||
gpuDebug->NotifySteppingExit();
|
||||
isStepping = false;
|
||||
StopStepping();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -263,4 +275,8 @@ void ForceUnpause() {
|
||||
actionWait.notify_all();
|
||||
}
|
||||
|
||||
GPUgstate LastState() {
|
||||
return lastGState;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Core/Core.h"
|
||||
#include "GPU/Common/GPUDebugInterface.h"
|
||||
#include "GPU/GPUState.h"
|
||||
|
||||
namespace GPUStepping {
|
||||
// Should be called from the emu thread.
|
||||
@@ -42,4 +43,6 @@ namespace GPUStepping {
|
||||
|
||||
void ResumeFromStepping();
|
||||
void ForceUnpause();
|
||||
|
||||
GPUgstate LastState();
|
||||
};
|
||||
Reference in new issue
Block a user