From 74f479ce6d956375f9bf9d2c3fd0b0b7a6f4ad56 Mon Sep 17 00:00:00 2001 From: RSDuck Date: Wed, 11 Sep 2024 14:34:58 +0200 Subject: [PATCH] gdb stub config setup fixes --- src/frontend/qt_sdl/Config.cpp | 2 +- src/frontend/qt_sdl/EmuInstance.cpp | 4 ++-- src/frontend/qt_sdl/EmuSettingsDialog.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/qt_sdl/Config.cpp b/src/frontend/qt_sdl/Config.cpp index 5997d54352..580af72e87 100644 --- a/src/frontend/qt_sdl/Config.cpp +++ b/src/frontend/qt_sdl/Config.cpp @@ -71,7 +71,7 @@ DefaultList DefaultInts = #ifdef GDBSTUB_ENABLED {"Instance*.Gdb.ARM7.Port", 3334}, {"Instance*.Gdb.ARM9.Port", 3333}, -#endif, +#endif {"LAN.HostNumPlayers", 16}, }; diff --git a/src/frontend/qt_sdl/EmuInstance.cpp b/src/frontend/qt_sdl/EmuInstance.cpp index b29d2b091c..e48f29a222 100644 --- a/src/frontend/qt_sdl/EmuInstance.cpp +++ b/src/frontend/qt_sdl/EmuInstance.cpp @@ -1153,14 +1153,14 @@ bool EmuInstance::updateConsole(UpdateConsoleNDSArgs&& _ndsargs, UpdateConsoleGB #endif #ifdef GDBSTUB_ENABLED - Config::Table gdbopt = globalCfg.GetTable("Gdb"); + Config::Table gdbopt = localCfg.GetTable("Gdb"); GDBArgs _gdbargs { static_cast(gdbopt.GetInt("ARM7.Port")), static_cast(gdbopt.GetInt("ARM9.Port")), gdbopt.GetBool("ARM7.BreakOnStartup"), gdbopt.GetBool("ARM9.BreakOnStartup"), }; - auto gdbargs = gdbopt.GetBool("Enable") ? std::make_optional(_gdbargs) : std::nullopt; + auto gdbargs = gdbopt.GetBool("Enabled") ? std::make_optional(_gdbargs) : std::nullopt; #else optional gdbargs = std::nullopt; #endif diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.cpp b/src/frontend/qt_sdl/EmuSettingsDialog.cpp index d612ac8358..7a6c0f4050 100644 --- a/src/frontend/qt_sdl/EmuSettingsDialog.cpp +++ b/src/frontend/qt_sdl/EmuSettingsDialog.cpp @@ -95,7 +95,7 @@ EmuSettingsDialog::EmuSettingsDialog(QWidget* parent) : QDialog(parent), ui(new #endif #ifdef GDBSTUB_ENABLED - ui->cbGdbEnabled->setChecked(cfg.GetBool("Gdb.Enabled")); + ui->cbGdbEnabled->setChecked(instcfg.GetBool("Gdb.Enabled")); ui->intGdbPortA7->setValue(instcfg.GetInt("Gdb.ARM7.Port")); ui->intGdbPortA9->setValue(instcfg.GetInt("Gdb.ARM9.Port")); ui->cbGdbBOSA7->setChecked(instcfg.GetBool("Gdb.ARM7.BreakOnStartup")); @@ -286,7 +286,7 @@ void EmuSettingsDialog::done(int r) cfg.SetBool("JIT.FastMemory", ui->chkJITFastMemory->isChecked()); #endif #ifdef GDBSTUB_ENABLED - cfg.SetBool("Gdb.Enabled", ui->cbGdbEnabled->isChecked()); + instcfg.SetBool("Gdb.Enabled", ui->cbGdbEnabled->isChecked()); instcfg.SetInt("Gdb.ARM7.Port", ui->intGdbPortA7->value()); instcfg.SetInt("Gdb.ARM9.Port", ui->intGdbPortA9->value()); instcfg.SetBool("Gdb.ARM7.BreakOnStartup", ui->cbGdbBOSA7->isChecked());