From 3842384a384ab8e209643fa1f79b72ace8f34c6b Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sat, 28 Dec 2024 18:47:17 +0100
Subject: [PATCH] dynapi: trigger a breakpoint on a fatal error when SDL is
built in debug mode
---
src/dynapi/SDL_dynapi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/dynapi/SDL_dynapi.c b/src/dynapi/SDL_dynapi.c
index 2fa85ec5f9920..f35f3e8bcb564 100644
--- a/src/dynapi/SDL_dynapi.c
+++ b/src/dynapi/SDL_dynapi.c
@@ -520,6 +520,9 @@ static void SDL_InitDynamicAPILocked(void)
if (initialize_jumptable(SDL_DYNAPI_VERSION, &jump_table, sizeof(jump_table)) < 0) {
// Now we're screwed. Should definitely abort now.
dynapi_warn("Failed to initialize internal SDL dynapi. As this would otherwise crash, we have to abort now.");
+#ifndef NDEBUG
+ SDL_TriggerBreakpoint();
+#endif
SDL_ExitProcess(86);
}
}