diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-03-06 18:51:18 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-03-06 18:51:18 +0100 |
| commit | 9c47b1fbf933d33804cba51d8aa6adf728810133 (patch) | |
| tree | f5f0e25ddf8c4738dc516a5bb9adc68a691d3ee5 /src | |
| parent | b525b0bdd4528ea19b8323c87f2eb31f45eaf3ab (diff) | |
| download | box64-9c47b1fbf933d33804cba51d8aa6adf728810133.tar.gz box64-9c47b1fbf933d33804cba51d8aa6adf728810133.zip | |
Added an option to always show SIGSEGV messages
Diffstat (limited to 'src')
| -rwxr-xr-x | src/include/debug.h | 1 | ||||
| -rwxr-xr-x | src/libtools/signals.c | 2 | ||||
| -rwxr-xr-x | src/main.c | 11 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/include/debug.h b/src/include/debug.h index 5a300117..7fb8d558 100755 --- a/src/include/debug.h +++ b/src/include/debug.h @@ -39,6 +39,7 @@ extern int box64_wine; extern int box64_nopulse; // disabling the use of wrapped pulseaudio extern int box64_nogtk; // disabling the use of wrapped gtk extern int box64_novulkan; // disabling the use of wrapped vulkan +extern int box64_showsegv; // show sigv, even if a signal handler is present extern uintptr_t fmod_smc_start, fmod_smc_end; // to handle libfmod (from Unreal) SMC (self modifying code) extern uint32_t default_gs; extern int jit_gdb; // launch gdb when a segfault is trapped diff --git a/src/libtools/signals.c b/src/libtools/signals.c index 7d4586dc..a98b570a 100755 --- a/src/libtools/signals.c +++ b/src/libtools/signals.c @@ -749,7 +749,7 @@ static pthread_mutex_t mutex_dynarec_prot; void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx) { // sig==SIGSEGV || sig==SIGBUS || sig==SIGILL here! - int log_minimum = (my_context->is_sigaction[sig] && sig==SIGSEGV)?LOG_DEBUG:LOG_INFO; + int log_minimum = (box64_showsegv)?LOG_NONE:((my_context->is_sigaction[sig] && sig==SIGSEGV)?LOG_DEBUG:LOG_INFO); ucontext_t *p = (ucontext_t *)ucntx; void* addr = (void*)info->si_addr; // address that triggered the issue void* rsp = NULL; diff --git a/src/main.c b/src/main.c index d5a420c2..34d2f58d 100755 --- a/src/main.c +++ b/src/main.c @@ -81,6 +81,7 @@ int box64_wine = 0; int box64_nopulse = 0; int box64_nogtk = 0; int box64_novulkan = 0; +int box64_showsegv = 0; char* libGL = NULL; uintptr_t fmod_smc_start = 0; uintptr_t fmod_smc_end = 0; @@ -548,6 +549,15 @@ void LoadLogEnv() if(jit_gdb) printf_log(LOG_INFO, "Launch %s on segfault\n", (jit_gdb==2)?"gdbserver":"gdb"); } + p = getenv("BOX64_SHOWSEGV"); + if(p) { + if(strlen(p)==1) { + if(p[0]>='0' && p[0]<='0'+1) + box64_showsegv = p[0]-'0'; + } + if(box64_showsegv) + printf_log(LOG_INFO, "Show Segfault signal even if a signal handler is present\n"); + } box64_pagesize = sysconf(_SC_PAGESIZE); if(!box64_pagesize) box64_pagesize = 4096; @@ -676,6 +686,7 @@ void PrintHelp() { printf(" BOX64_LOAD_ADDR=0xXXXXXX try to load at 0xXXXXXX main binary (if binary is a PIE)\n"); printf(" BOX64_NOSIGSEGV=1 to disable handling of SigSEGV\n"); printf(" BOX64_NOSIGILL=1 to disable handling of SigILL\n"); + printf(" BOX64_SHOWSEGV=1 to show Segfault signal even if a signal handler is present\n"); printf(" BOX64_X11THREADS=1 to call XInitThreads when loading X11 (for old Loki games with Loki_Compat lib)"); printf(" BOX64_LIBGL=libXXXX set the name (and optionnaly full path) for libGL.so.1\n"); printf(" BOX64_LD_PRELOAD=XXXX[:YYYYY] force loading XXXX (and YYYY...) libraries with the binary\n"); |