mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
make it possible to change gdb stub settings without destroying/recreating a NDS
This commit is contained in:
28
src/ARM.cpp
28
src/ARM.cpp
@ -109,21 +109,13 @@ const u32 ARM::ConditionTable[16] =
|
||||
|
||||
ARM::ARM(u32 num, bool jit, std::optional<GDBArgs> gdb, melonDS::NDS& nds) :
|
||||
#ifdef GDBSTUB_ENABLED
|
||||
GdbStub(this, gdb ? (num ? gdb->PortARM7 : gdb->PortARM9) : 0),
|
||||
BreakOnStartup(gdb ? (num ? gdb->ARM7BreakOnStartup : gdb->ARM9BreakOnStartup) : false),
|
||||
GdbStub(this),
|
||||
BreakOnStartup(false),
|
||||
#endif
|
||||
Num(num), // well uh
|
||||
NDS(nds)
|
||||
{
|
||||
#ifdef GDBSTUB_ENABLED
|
||||
if (gdb
|
||||
#ifdef JIT_ENABLED
|
||||
&& !jit // TODO: Should we support toggling the GdbStub without destroying the ARM?
|
||||
#endif
|
||||
)
|
||||
GdbStub.Init();
|
||||
IsSingleStep = false;
|
||||
#endif
|
||||
SetGdbArgs(jit ? gdb : std::nullopt);
|
||||
}
|
||||
|
||||
ARM::~ARM()
|
||||
@ -148,6 +140,20 @@ ARMv5::~ARMv5()
|
||||
// DTCM is owned by Memory, not going to delete it
|
||||
}
|
||||
|
||||
void ARM::SetGdbArgs(std::optional<GDBArgs> gdb)
|
||||
{
|
||||
#ifdef GDBSTUB_ENABLED
|
||||
GdbStub.Close();
|
||||
if (gdb)
|
||||
{
|
||||
int port = Num ? gdb->PortARM7 : gdb->PortARM9;
|
||||
GdbStub.Init(port);
|
||||
BreakOnStartup = Num ? gdb->ARM7BreakOnStartup : gdb->ARM9BreakOnStartup;
|
||||
}
|
||||
IsSingleStep = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void ARM::Reset()
|
||||
{
|
||||
Cycles = 0;
|
||||
|
Reference in New Issue
Block a user