From 31dee93e849d79a91f280faf16941806e3cb3c6b Mon Sep 17 00:00:00 2001 From: polaris- Date: Wed, 2 Sep 2015 08:56:38 -0400 Subject: Implement gdbstub --- src/citra_qt/config.cpp | 10 ++++++++++ src/citra_qt/main.cpp | 12 ++++++++++++ src/citra_qt/main.h | 1 + src/citra_qt/main.ui | 9 +++++++++ 4 files changed, 32 insertions(+) (limited to 'src/citra_qt') diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index 1f4981ce1..8e247ff5c 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp @@ -62,6 +62,11 @@ void Config::ReadValues() { qt_config->beginGroup("Miscellaneous"); Settings::values.log_filter = qt_config->value("log_filter", "*:Info").toString().toStdString(); qt_config->endGroup(); + + qt_config->beginGroup("Debugging"); + Settings::values.use_gdbstub = qt_config->value("use_gdbstub", false).toBool(); + Settings::values.gdbstub_port = qt_config->value("gdbstub_port", 24689).toInt(); + qt_config->endGroup(); } void Config::SaveValues() { @@ -97,6 +102,11 @@ void Config::SaveValues() { qt_config->beginGroup("Miscellaneous"); qt_config->setValue("log_filter", QString::fromStdString(Settings::values.log_filter)); qt_config->endGroup(); + + qt_config->beginGroup("Debugging"); + qt_config->setValue("use_gdbstub", Settings::values.use_gdbstub); + qt_config->setValue("gdbstub_port", Settings::values.gdbstub_port); + qt_config->endGroup(); } void Config::Reload() { diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 298649aaf..d8d17f466 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -48,6 +48,8 @@ #include "video_core/video_core.h" +#include "core/gdbstub/gdbstub.h" + GMainWindow::GMainWindow() : emu_thread(nullptr) { Pica::g_debug_context = Pica::DebugContext::Construct(); @@ -143,6 +145,11 @@ GMainWindow::GMainWindow() : emu_thread(nullptr) game_list->LoadInterfaceLayout(settings); + ui.action_Use_Gdbstub->setChecked(Settings::values.use_gdbstub); + SetGdbstubEnabled(ui.action_Use_Gdbstub->isChecked()); + + GDBStub::SetServerPort(static_cast(Settings::values.gdbstub_port)); + ui.action_Use_Hardware_Renderer->setChecked(Settings::values.use_hw_renderer); SetHardwareRendererEnabled(ui.action_Use_Hardware_Renderer->isChecked()); @@ -175,6 +182,7 @@ GMainWindow::GMainWindow() : emu_thread(nullptr) connect(ui.action_Stop, SIGNAL(triggered()), this, SLOT(OnStopGame())); connect(ui.action_Use_Hardware_Renderer, SIGNAL(triggered(bool)), this, SLOT(SetHardwareRendererEnabled(bool))); connect(ui.action_Use_Shader_JIT, SIGNAL(triggered(bool)), this, SLOT(SetShaderJITEnabled(bool))); + connect(ui.action_Use_Gdbstub, SIGNAL(triggered(bool)), this, SLOT(SetGdbstubEnabled(bool))); connect(ui.action_Single_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(ToggleWindowMode())); connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog())); @@ -445,6 +453,10 @@ void GMainWindow::SetHardwareRendererEnabled(bool enabled) { VideoCore::g_hw_renderer_enabled = enabled; } +void GMainWindow::SetGdbstubEnabled(bool enabled) { + GDBStub::ToggleServer(enabled); +} + void GMainWindow::SetShaderJITEnabled(bool enabled) { VideoCore::g_shader_jit_enabled = enabled; } diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 6d27ce6a9..f6d429cd9 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -99,6 +99,7 @@ private slots: void OnConfigure(); void OnDisplayTitleBars(bool); void SetHardwareRendererEnabled(bool); + void SetGdbstubEnabled(bool); void SetShaderJITEnabled(bool); void ToggleWindowMode(); diff --git a/src/citra_qt/main.ui b/src/citra_qt/main.ui index 997597642..1e8a07cfb 100644 --- a/src/citra_qt/main.ui +++ b/src/citra_qt/main.ui @@ -75,6 +75,7 @@ + @@ -170,6 +171,14 @@ Use Shader JIT + + + true + + + Use Gdbstub + + Configure ... -- cgit v1.2.3 From a5ab8accc21e73be9564bebde4d3b20b38d85b6e Mon Sep 17 00:00:00 2001 From: polaris- Date: Wed, 21 Oct 2015 22:19:55 -0400 Subject: Handle changes pointed out in comments on PR --- src/citra_qt/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/citra_qt') diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index d8d17f466..e5ed01a11 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -44,12 +44,11 @@ #include "core/settings.h" #include "core/system.h" #include "core/arm/disassembler/load_symbol_map.h" +#include "core/gdbstub/gdbstub.h" #include "core/loader/loader.h" #include "video_core/video_core.h" -#include "core/gdbstub/gdbstub.h" - GMainWindow::GMainWindow() : emu_thread(nullptr) { Pica::g_debug_context = Pica::DebugContext::Construct(); -- cgit v1.2.3