Core: Reattaching the same debugger is a no-op

This commit is contained in:
Vicki Pfau 2023-05-10 23:08:29 -07:00
parent 196f507d3b
commit a7d63cde54
2 changed files with 6 additions and 0 deletions

View File

@ -1061,6 +1061,9 @@ static struct CLIDebuggerSystem* _GBCoreCliDebuggerSystem(struct mCore* core) {
static void _GBCoreAttachDebugger(struct mCore* core, struct mDebugger* debugger) {
struct SM83Core* cpu = core->cpu;
if (core->debugger == debugger) {
return;
}
if (core->debugger) {
SM83HotplugDetach(cpu, CPU_COMPONENT_DEBUGGER);
}

View File

@ -1129,6 +1129,9 @@ static struct CLIDebuggerSystem* _GBACoreCliDebuggerSystem(struct mCore* core) {
}
static void _GBACoreAttachDebugger(struct mCore* core, struct mDebugger* debugger) {
if (core->debugger == debugger) {
return;
}
if (core->debugger) {
GBADetachDebugger(core->board);
}