From e1d6dfc32449337588da8c37d06cfced1e5576de Mon Sep 17 00:00:00 2001 From: Ziemas Date: Wed, 1 Feb 2023 12:53:31 +0100 Subject: [PATCH] Add command line boot and debug option --- pcsx2-qt/MainWindow.h | 3 ++- pcsx2-qt/QtHost.cpp | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pcsx2-qt/MainWindow.h b/pcsx2-qt/MainWindow.h index e9ec8c2981..54c8f945c2 100644 --- a/pcsx2-qt/MainWindow.h +++ b/pcsx2-qt/MainWindow.h @@ -110,6 +110,8 @@ public: /// Rescans a single file. NOTE: Happens on UI thread. void rescanFile(const std::string& path); + void openDebugger(); + public Q_SLOTS: void checkForUpdates(bool display_message, bool force_check); void refreshGameList(bool invalidate_cache); @@ -241,7 +243,6 @@ private: void updateInputRecordingActions(bool started); DebuggerWindow* getDebuggerWindow(); - void openDebugger(); ControllerSettingsDialog* getControllerSettingsDialog(); void doControllerSettings(ControllerSettingsDialog::Category category = ControllerSettingsDialog::Category::Count); diff --git a/pcsx2-qt/QtHost.cpp b/pcsx2-qt/QtHost.cpp index d174985509..e697a988c2 100644 --- a/pcsx2-qt/QtHost.cpp +++ b/pcsx2-qt/QtHost.cpp @@ -96,6 +96,7 @@ static bool s_nogui_mode = false; static bool s_start_fullscreen_ui = false; static bool s_start_fullscreen_ui_fullscreen = false; static bool s_test_config_and_exit = false; +static bool s_boot_and_debug = false; ////////////////////////////////////////////////////////////////////////// // CPU Thread @@ -1621,6 +1622,7 @@ void QtHost::PrintCommandLineHelp(const std::string_view& progname) std::fprintf(stderr, " -nofullscreen: Prevents fullscreen mode from triggering if enabled.\n"); std::fprintf(stderr, " -earlyconsolelog: Forces logging of early console messages to console.\n"); std::fprintf(stderr, " -testconfig: Initializes configuration and checks version, then exits.\n"); + std::fprintf(stderr, " -debugger: Open debugger and break on entry point.\n"); #ifdef ENABLE_RAINTEGRATION std::fprintf(stderr, " -raintegration: Use RAIntegration instead of built-in achievement support.\n"); #endif @@ -1743,6 +1745,11 @@ bool QtHost::ParseCommandLineOptions(const QStringList& args, std::shared_ptrstartFullscreenUI(s_start_fullscreen_ui_fullscreen); + if (s_boot_and_debug) + { + DebugInterface::setPauseOnEntry(true); + main_window->openDebugger(); + } + // Skip the update check if we're booting a game directly. if (autoboot) g_emu_thread->startVM(std::move(autoboot));