From 7f78ea74cafa9c1c8801d1238aec501d7db89f55 Mon Sep 17 00:00:00 2001 From: OpenSauce04 Date: Sat, 5 Oct 2024 20:17:41 +0100 Subject: [PATCH] lime_qt: Added `-g` option for enabling GDB stub --- src/lime_qt/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lime_qt/main.cpp b/src/lime_qt/main.cpp index a7c0d12f8..a558f51d0 100644 --- a/src/lime_qt/main.cpp +++ b/src/lime_qt/main.cpp @@ -317,6 +317,16 @@ GMainWindow::GMainWindow(Core::System& system_) continue; } + // Enable GDB stub + if (args[i] == QStringLiteral("-g")) { + if (i >= args.size() - 1 || args[i + 1].startsWith(QChar::fromLatin1('-'))) { + continue; + } + Settings::values.use_gdbstub = true; + Settings::values.gdbstub_port = strtoul(args[++i].toLatin1(), NULL, 0); + continue; + } + if (args[i] == QStringLiteral("-p")) { if (i >= args.size() - 1 || args[i + 1].startsWith(QChar::fromLatin1('-'))) { continue; @@ -3645,6 +3655,7 @@ static void PrintHelp(const char* argv0) { std::cout << "Usage: " << argv0 << " [options] \n" "-d [path] Dump video recording of emulator playback to the given file path\n" + "-g [port] Enable gdb stub on the given port\n" "-f Start in fullscreen mode\n" "-h Display this help and exit\n" "-i [path] Install a CIA file at the given path\n"