mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-04-23 03:10:58 +00:00
vm_exec: Add debugger hooks for instruction execution events
This commit is contained in:
parent
a5a311bf0b
commit
a9ee0b7da3
2 changed files with 8 additions and 2 deletions
|
@ -43,6 +43,7 @@
|
|||
#include "basics.h"
|
||||
#include "texturemanager.h"
|
||||
#include "palutil.h"
|
||||
#include "common/scripting/dap/RuntimeEvents.h"
|
||||
|
||||
extern cycle_t VMCycles[10];
|
||||
extern int VMCalls[10];
|
||||
|
@ -63,7 +64,7 @@ void ThrowVMException(VMException *x);
|
|||
|
||||
#if COMPGOTO
|
||||
#define OP(x) x
|
||||
#define NEXTOP do { pc++; unsigned op = pc->op; a = pc->a; goto *ops[op]; } while(0)
|
||||
#define NEXTOP do { pc++; DebugServer::RuntimeEvents::EmitInstructionExecutionEvent(stack, ret, numret, pc); unsigned op = pc->op; a = pc->a; goto *ops[op]; } while(0)
|
||||
#else
|
||||
#define OP(x) case OP_##x
|
||||
#define NEXTOP pc++; break
|
||||
|
|
|
@ -71,7 +71,9 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
|
|||
{
|
||||
#if !COMPGOTO
|
||||
VM_UBYTE op;
|
||||
for(;;) switch(op = pc->op, a = pc->a, op)
|
||||
for(;;) {
|
||||
DebugServer::RuntimeEvents::EmitInstructionExecutionEvent(stack, ret, numret, pc);
|
||||
switch(op = pc->op, a = pc->a, op)
|
||||
#else
|
||||
pc--;
|
||||
NEXTOP;
|
||||
|
@ -1951,6 +1953,9 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
|
|||
NEXTOP;
|
||||
}
|
||||
}
|
||||
#if !COMPGOTO
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
catch(VMException *exception)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue