summaryrefslogtreecommitdiffstats
path: root/src/citra
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/citra/citra.cpp3
-rw-r--r--src/citra/config.cpp4
-rw-r--r--src/citra/default_ini.h5
-rw-r--r--src/citra_qt/config.cpp10
-rw-r--r--src/citra_qt/main.cpp20
-rw-r--r--src/citra_qt/main.h1
-rw-r--r--src/citra_qt/main.ui9
7 files changed, 52 insertions, 0 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index 46f4a07c9..b36865395 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -30,6 +30,8 @@
#include "video_core/video_core.h"
+#include "core/gdbstub/gdbstub.h"
+
static void PrintHelp()
{
@@ -72,6 +74,7 @@ int main(int argc, char **argv) {
Config config;
log_filter.ParseFilterString(Settings::values.log_filter);
+ GDBStub::SetServerPort(static_cast<u32>(Settings::values.gdbstub_port));
EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;
diff --git a/src/citra/config.cpp b/src/citra/config.cpp
index 8a98bda87..af343e9fe 100644
--- a/src/citra/config.cpp
+++ b/src/citra/config.cpp
@@ -75,6 +75,10 @@ void Config::ReadValues() {
// Miscellaneous
Settings::values.log_filter = glfw_config->Get("Miscellaneous", "log_filter", "*:Info");
+
+ // GDBStubebugging
+ Settings::values.use_gdbstub = glfw_config->GetBoolean("Debugging", "use_gdbstub", false);
+ Settings::values.gdbstub_port = glfw_config->GetInteger("Debugging", "gdbstub_port", 24689);
}
void Config::Reload() {
diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h
index 7e5d49729..5ba40a8ed 100644
--- a/src/citra/default_ini.h
+++ b/src/citra/default_ini.h
@@ -66,6 +66,11 @@ region_value =
# A filter which removes logs below a certain logging level.
# Examples: *:Debug Kernel.SVC:Trace Service.*:Critical
log_filter = *:Info
+
+[Debugging]
+# Port for listening to GDB connections.
+use_gdbstub=false
+gdbstub_port=24689
)";
}
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 01841b33c..e032cf639 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -47,6 +47,12 @@
#include "video_core/video_core.h"
+#ifdef USE_GDBSTUB
+#include "core/gdbstub/gdbstub.h"
+#endif
+
+#include "core/gdbstub/gdbstub.h"
+
GMainWindow::GMainWindow() : emu_thread(nullptr)
{
Pica::g_debug_context = Pica::DebugContext::Construct();
@@ -137,6 +143,15 @@ GMainWindow::GMainWindow() : emu_thread(nullptr)
microProfileDialog->setVisible(settings.value("microProfileDialogVisible").toBool());
settings.endGroup();
+#ifdef USE_GDBSTUB
+ Gdbstub::SetServerPort(static_cast<u32>(Settings::values.gdbstub_port));
+#endif
+
+ ui.action_Use_Gdbstub->setChecked(Settings::values.use_gdbstub);
+ SetGdbstubEnabled(ui.action_Use_Gdbstub->isChecked());
+
+ GDBStub::SetServerPort(static_cast<u32>(Settings::values.gdbstub_port));
+
ui.action_Use_Hardware_Renderer->setChecked(Settings::values.use_hw_renderer);
SetHardwareRendererEnabled(ui.action_Use_Hardware_Renderer->isChecked());
@@ -167,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()));
@@ -414,6 +430,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 32523fded..daa3d1c95 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -94,6 +94,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 1ba700a3a..88d04439a 100644
--- a/src/citra_qt/main.ui
+++ b/src/citra_qt/main.ui
@@ -74,6 +74,7 @@
<addaction name="separator"/>
<addaction name="action_Use_Hardware_Renderer"/>
<addaction name="action_Use_Shader_JIT"/>
+ <addaction name="action_Use_Gdbstub"/>
<addaction name="action_Configure"/>
</widget>
<widget class="QMenu" name="menu_View">
@@ -169,6 +170,14 @@
<string>Use Shader JIT</string>
</property>
</action>
+ <action name="action_Use_Gdbstub">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Use Gdbstub</string>
+ </property>
+ </action>
<action name="action_Configure">
<property name="text">
<string>Configure ...</string>