NDSSystem: replace GDB_STUB ifdefs with macro

This commit is contained in:
rofl0r 2021-10-23 21:43:38 +00:00
parent 70a1727bd5
commit 747f7b114b
1 changed files with 11 additions and 14 deletions

View File

@ -67,6 +67,11 @@ extern HWND DisViewWnd[2];
#ifdef GDB_STUB
#include "gdbstub.h"
#define GDBSTUB_MUTEX_LOCK() gdbstub_mutex_lock()
#define GDBSTUB_MUTEX_UNLOCK() gdbstub_mutex_unlock()
#else
#define GDBSTUB_MUTEX_LOCK() do {} while(0)
#define GDBSTUB_MUTEX_UNLOCK() do {} while(0)
#endif
//int xxctr=0;
@ -2056,9 +2061,7 @@ void NDS_debug_step()
template<bool FORCE>
void NDS_exec(s32 nb)
{
#ifdef GDB_STUB
gdbstub_mutex_lock();
#endif
GDBSTUB_MUTEX_LOCK();
LagFrameFlag=1;
@ -2092,13 +2095,9 @@ void NDS_exec(s32 nb)
while((NDS_ARM9.stalled || NDS_ARM7.stalled) && execute)
{
#ifdef GDB_STUB
gdbstub_mutex_unlock();
#endif
GDBSTUB_MUTEX_UNLOCK();
driver->EMU_DebugIdleUpdate();
#ifdef GDB_STUB
gdbstub_mutex_lock();
#endif
GDBSTUB_MUTEX_LOCK();
nds_debug_continuing[0] = nds_debug_continuing[1] = true;
}
@ -2199,9 +2198,7 @@ void NDS_exec(s32 nb)
DEBUG_Notify.NextFrame();
if(cheats) cheats->process(CHEAT_TYPE_INTERNAL);
#ifdef GDB_STUB
gdbstub_mutex_unlock();
#endif
GDBSTUB_MUTEX_UNLOCK();
}
template<int PROCNUM> static void execHardware_interrupts_core()