From 1cccecf5431fd993ec14b8eb89632f13be5c3568 Mon Sep 17 00:00:00 2001 From: mittorn Date: Sat, 2 Dec 2023 21:40:59 +0300 Subject: [PATCH] platform/android-nosdl: restore SIGTRAP handler --- engine/platform/android/android_nosdl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/platform/android/android_nosdl.c b/engine/platform/android/android_nosdl.c index e87fb0e9..5c154fe3 100644 --- a/engine/platform/android/android_nosdl.c +++ b/engine/platform/android/android_nosdl.c @@ -212,10 +212,11 @@ nativeSetPause #define DECLARE_JNI_INTERFACE( ret, name, ... ) \ JNIEXPORT ret JNICALL Java_su_xash_engine_XashBinding_##name( JNIEnv *env, jclass clazz VA_ARGS(__VA_ARGS__) ) -static int _debugger_present = -1; +static volatile int _debugger_present = -1; static void _sigtrap_handler(int signum) { _debugger_present = 0; + __android_log_print( ANDROID_LOG_ERROR, "XashGDBWait", "It's a TRAP!" ); } DECLARE_JNI_INTERFACE( int, nativeInit, jobject array ) @@ -295,6 +296,7 @@ DECLARE_JNI_INTERFACE( int, nativeInit, jobject array ) INLINE_RAISE( SIGTRAP ); INLINE_NANOSLEEP1(); } + signal(SIGTRAP, SIG_DFL); } /* Run the application. */