Qt: Move GDB server enable to advanced options

And expose the port as a setting.
This commit is contained in:
Stenzek 2024-10-11 21:26:04 +10:00
parent 7ce4c34936
commit 407dccb1db
No known key found for this signature in database
5 changed files with 27 additions and 16 deletions

View File

@ -435,8 +435,12 @@ void Settings::Load(SettingsInterface& si, SettingsInterface& controller_si)
debugging.show_vram = si.GetBoolValue("Debug", "ShowVRAM");
debugging.dump_cpu_to_vram_copies = si.GetBoolValue("Debug", "DumpCPUToVRAMCopies");
debugging.dump_vram_to_cpu_copies = si.GetBoolValue("Debug", "DumpVRAMToCPUCopies");
#ifndef __ANDROID__
debugging.enable_gdb_server = si.GetBoolValue("Debug", "EnableGDBServer");
debugging.gdb_server_port = static_cast<u16>(si.GetIntValue("Debug", "GDBServerPort"));
debugging.gdb_server_port = static_cast<u16>(si.GetUIntValue("Debug", "GDBServerPort", DEFAULT_GDB_SERVER_PORT));
#endif
debugging.show_gpu_state = si.GetBoolValue("Debug", "ShowGPUState");
debugging.show_cdrom_state = si.GetBoolValue("Debug", "ShowCDROMState");
debugging.show_spu_state = si.GetBoolValue("Debug", "ShowSPUState");
@ -709,6 +713,12 @@ void Settings::Save(SettingsInterface& si, bool ignore_base) const
si.SetBoolValue("Debug", "ShowVRAM", debugging.show_vram);
si.SetBoolValue("Debug", "DumpCPUToVRAMCopies", debugging.dump_cpu_to_vram_copies);
si.SetBoolValue("Debug", "DumpVRAMToCPUCopies", debugging.dump_vram_to_cpu_copies);
#ifndef __ANDROID__
si.SetBoolValue("Debug", "EnableGDBServer", debugging.enable_gdb_server);
si.SetUIntValue("Debug", "GDBServerPort", debugging.gdb_server_port);
#endif
si.SetBoolValue("Debug", "ShowGPUState", debugging.show_gpu_state);
si.SetBoolValue("Debug", "ShowCDROMState", debugging.show_cdrom_state);
si.SetBoolValue("Debug", "ShowSPUState", debugging.show_spu_state);

View File

@ -226,8 +226,10 @@ struct Settings
bool dump_cpu_to_vram_copies : 1 = false;
bool dump_vram_to_cpu_copies : 1 = false;
#ifndef __ANDROID__
bool enable_gdb_server : 1 = false;
u16 gdb_server_port = 1234;
u16 gdb_server_port = DEFAULT_GDB_SERVER_PORT;
#endif
// Mutable because the imgui window can close itself.
mutable bool show_gpu_state = false;
@ -555,6 +557,7 @@ struct Settings
#ifndef __ANDROID__
static constexpr bool DEFAULT_SAVE_STATE_BACKUPS = true;
static constexpr bool DEFAULT_FAST_BOOT_VALUE = false;
static constexpr u16 DEFAULT_GDB_SERVER_PORT = 2345;
#else
static constexpr bool DEFAULT_SAVE_STATE_BACKUPS = false;
static constexpr bool DEFAULT_FAST_BOOT_VALUE = true;

View File

@ -265,6 +265,10 @@ void AdvancedSettingsWidget::addTweakOptions()
addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Allow Booting Without SBI File"), "CDROM",
"AllowBootingWithoutSBIFile", false);
addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Enable GDB Server"), "Debug", "EnableGDBServer", false);
addIntRangeTweakOption(m_dialog, m_ui.tweakOptionTable, tr("GDB Server Port"), "Debug", "GDBServerPort", 1, 65535,
Settings::DEFAULT_GDB_SERVER_PORT);
addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Export Shared Memory"), "Hacks", "ExportSharedMemory",
false);
addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Enable PCDrv"), "PCDrv", "Enabled", false);
@ -300,10 +304,12 @@ void AdvancedSettingsWidget::onResetToDefaultClicked()
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // CDROM Region Check
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // CDROM SubQ Skew
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Allow booting without SBI file
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Export Shared Memory
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV Writes
setDirectoryOption(m_ui.tweakOptionTable, i++, ""); // PCDrv Root Directory
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable GDB Server
setIntRangeTweakOption(m_ui.tweakOptionTable, i++, Settings::DEFAULT_GDB_SERVER_PORT); // GDB Server Port
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Export Shared Memory
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV
setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV Writes
setDirectoryOption(m_ui.tweakOptionTable, i++, ""); // PCDrv Root Directory
return;
}
@ -329,6 +335,8 @@ void AdvancedSettingsWidget::onResetToDefaultClicked()
sif->DeleteValue("CDROM", "RegionCheck");
sif->DeleteValue("CDROM", "SubQSkew");
sif->DeleteValue("CDROM", "AllowBootingWithoutSBIFile");
sif->DeleteValue("Debug", "EnableGDBServer");
sif->DeleteValue("Debug", "GDBServerPort");
sif->DeleteValue("PCDrv", "Enabled");
sif->DeleteValue("PCDrv", "EnableWrites");
sif->DeleteValue("PCDrv", "Root");

View File

@ -2094,7 +2094,6 @@ void MainWindow::connectSignals()
connect(m_ui.actionCoverDownloader, &QAction::triggered, this, &MainWindow::onToolsCoverDownloaderTriggered);
connect(m_ui.actionMediaCapture, &QAction::toggled, this, &MainWindow::onToolsMediaCaptureToggled);
connect(m_ui.actionCPUDebugger, &QAction::triggered, this, &MainWindow::openCPUDebugger);
SettingWidgetBinder::BindWidgetToBoolSetting(nullptr, m_ui.actionEnableGDBServer, "Debug", "EnableGDBServer", false);
connect(m_ui.actionOpenDataDirectory, &QAction::triggered, this, &MainWindow::onToolsOpenDataDirectoryTriggered);
connect(m_ui.actionOpenTextureDirectory, &QAction::triggered, this, &MainWindow::onToolsOpenTextureDirectoryTriggered);
connect(m_ui.actionReloadTextureReplacements, &QAction::triggered, g_emu_thread, &EmuThread::reloadTextureReplacements);

View File

@ -160,7 +160,6 @@
<addaction name="actionDisableAllEnhancements"/>
<addaction name="separator"/>
<addaction name="actionCPUDebugger"/>
<addaction name="actionEnableGDBServer"/>
<addaction name="separator"/>
<addaction name="actionDumpRAM"/>
<addaction name="actionDumpVRAM"/>
@ -798,14 +797,6 @@
<string>CPU D&amp;ebugger</string>
</property>
</action>
<action name="actionEnableGDBServer">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Enable GDB Server</string>
</property>
</action>
<action name="actionViewGameGrid">
<property name="icon">
<iconset theme="function-line"/>