summaryrefslogtreecommitdiffstats
path: root/src/yuzu_cmd
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-06-13 20:38:37 +0200
committerGitHub <noreply@github.com>2022-06-13 20:38:37 +0200
commita0407a8e646172392514dd996d62464db64aee83 (patch)
treeb13a559bcb4a9f9641730d58285a56bde6d5cc80 /src/yuzu_cmd
parentMerge pull request #8454 from liamwhite/inaddr-any (diff)
parentyuzu-cmd: ignore bogus timeous from SDL (diff)
downloadyuzu-a0407a8e646172392514dd996d62464db64aee83.tar
yuzu-a0407a8e646172392514dd996d62464db64aee83.tar.gz
yuzu-a0407a8e646172392514dd996d62464db64aee83.tar.bz2
yuzu-a0407a8e646172392514dd996d62464db64aee83.tar.lz
yuzu-a0407a8e646172392514dd996d62464db64aee83.tar.xz
yuzu-a0407a8e646172392514dd996d62464db64aee83.tar.zst
yuzu-a0407a8e646172392514dd996d62464db64aee83.zip
Diffstat (limited to 'src/yuzu_cmd')
-rw-r--r--src/yuzu_cmd/config.cpp2
-rw-r--r--src/yuzu_cmd/default_ini.h5
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2.cpp10
-rw-r--r--src/yuzu_cmd/yuzu.cpp9
4 files changed, 25 insertions, 1 deletions
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp
index fc16f0f0c..fc4744fb0 100644
--- a/src/yuzu_cmd/config.cpp
+++ b/src/yuzu_cmd/config.cpp
@@ -344,6 +344,8 @@ void Config::ReadValues() {
ReadSetting("Debugging", Settings::values.use_debug_asserts);
ReadSetting("Debugging", Settings::values.use_auto_stub);
ReadSetting("Debugging", Settings::values.disable_macro_jit);
+ ReadSetting("Debugging", Settings::values.use_gdbstub);
+ ReadSetting("Debugging", Settings::values.gdbstub_port);
const auto title_list = sdl2_config->Get("AddOns", "title_ids", "");
std::stringstream ss(title_list);
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h
index 39063e32b..a3b8432f5 100644
--- a/src/yuzu_cmd/default_ini.h
+++ b/src/yuzu_cmd/default_ini.h
@@ -437,6 +437,11 @@ disable_macro_jit=false
# Presents guest frames as they become available. Experimental.
# false: Disabled (default), true: Enabled
disable_fps_limit=false
+# Determines whether to enable the GDB stub and wait for the debugger to attach before running.
+# false: Disabled (default), true: Enabled
+use_gdbstub=false
+# The port to use for the GDB server, if it is enabled.
+gdbstub_port=6543
[WebService]
# Whether or not to enable telemetry
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
index 71c413e64..8e38724db 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
@@ -162,7 +162,15 @@ void EmuWindow_SDL2::WaitEvent() {
SDL_Event event;
if (!SDL_WaitEvent(&event)) {
- LOG_CRITICAL(Frontend, "SDL_WaitEvent failed: {}", SDL_GetError());
+ const char* error = SDL_GetError();
+ if (!error || strcmp(error, "") == 0) {
+ // https://github.com/libsdl-org/SDL/issues/5780
+ // Sometimes SDL will return without actually having hit an error condition;
+ // just ignore it in this case.
+ return;
+ }
+
+ LOG_CRITICAL(Frontend, "SDL_WaitEvent failed: {}", error);
exit(1);
}
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index ab12dd15d..0dce5e274 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -217,10 +217,19 @@ int main(int argc, char** argv) {
[](VideoCore::LoadCallbackStage, size_t value, size_t total) {});
}
+ system.RegisterExitCallback([&] {
+ // Just exit right away.
+ exit(0);
+ });
+
void(system.Run());
+ if (system.DebuggerEnabled()) {
+ system.InitializeDebugger();
+ }
while (emu_window->IsOpen()) {
emu_window->WaitEvent();
}
+ system.DetachDebugger();
void(system.Pause());
system.Shutdown();