Add --debugger command line flag to enable the WebSocket debugger

Application-mode only (CmdLineMode::Application) - the headless build has
its own separate --debugger=PORT mechanism in headless/Headless.cpp, which
doesn't currently work reliably, so this new flag intentionally does not
apply there. Sets bRemoteDebuggerOnStartup for the session without
persisting it to the config file.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XDNwPPuidmNxQGRJxBuRL6
This commit is contained in:
Henrik RydgårdandClaude Opus 5 committed 2026-07-26 21:02:00 +02:00
1 parent 2fa8efad2b
commit 3ebc9872a5
2 files changed
+9

No files matched your search

+6
View File
@@ -139,6 +139,7 @@ static const CommandLineParam g_autoParams[] = {
{POFF(startScreen), CmdParamType::String, "start-screen", '\0', "Start on a specific screen (e.g. 'gamesettings', 'touchscreentest')", CmdLineMode::Application},
{POFF(escapeExit), CmdParamType::Bool, "escape-exit", '\0', "Escape key exits the application", CmdLineMode::Application},
{POFF(pauseMenuExit), CmdParamType::Bool, "pause-menu-exit", '\0', "Change \"Exit to menu\" in pause menu to \"Exit\"", CmdLineMode::Application},
{POFF(enableDebugger), CmdParamType::Bool, "debugger", '\0', "Enable the WebSocket debugger on startup (see docs/WebSocketDebugger.md)", CmdLineMode::Application},
{POFF(appendConfig), CmdParamType::String, "appendconfig", '\0', "Merge config FILE into the current configuration"},
{POFF(root), CmdParamType::String, "root", 'r', "Mount root directory"},
{POFF(stateToLoad), CmdParamType::String, "state", '\0', "Load state from specified file"},
@@ -395,6 +396,11 @@ void CommandLineOptions::ApplyToConfig() const {
g_Config.bPauseMenuExitsEmulator = pauseMenuExit.value();
}
if (enableDebugger.has_value()) {
g_Config.bRemoteDebuggerOnStartup = enableDebugger.value();
g_Config.DoNotSaveSetting(&g_Config.bRemoteDebuggerOnStartup);
}
if (logLevel.has_value()) {
g_logManager.SetAllLogLevels(logLevel.value());
}
+3
View File
@@ -40,6 +40,9 @@ struct CommandLineOptions {
std::optional<bool> escapeExit;
std::optional<bool> pauseMenuExit;
// Enables the WebSocket debugger on startup (Application mode only - see docs/WebSocketDebugger.md).
std::optional<bool> enableDebugger;
std::optional<std::string> appendConfig;
std::optional<std::string> root; // mount root, needs more explanation
std::optional<std::string> stateToLoad;