From e517e5877659a5669113401ab12df2936c11c3f1 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 6 Mar 2022 16:27:19 +0100 Subject: Improved speed of mmap changes --- src/include/debug.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include/debug.h') diff --git a/src/include/debug.h b/src/include/debug.h index 0cb2be34..5a300117 100755 --- a/src/include/debug.h +++ b/src/include/debug.h @@ -32,6 +32,7 @@ extern uintptr_t trace_start, trace_end; extern char* trace_func; #endif extern int allow_missing_libs; +extern int box64_mapclean; extern int box64_prefer_wrapped; extern int box64_steam; extern int box64_wine; -- cgit 1.4.1 From 9c47b1fbf933d33804cba51d8aa6adf728810133 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 6 Mar 2022 18:51:18 +0100 Subject: Added an option to always show SIGSEGV messages --- docs/USAGE.md | 5 +++++ src/include/debug.h | 1 + src/libtools/signals.c | 2 +- src/main.c | 11 +++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src/include/debug.h') diff --git a/docs/USAGE.md b/docs/USAGE.md index dfa34b4f..9d90e7dd 100755 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -78,6 +78,11 @@ Disable handling of SigILL (to ease debugging mainly). * 0 : Let x86 program set sighandler for Illegal Instruction * 1 : Disables the handling of SigILL +#### BOX64_SHOWSEGV +Show Segfault signal even if a signal handler is present + * 0 : Don"t force show the SIGSEGV analysis (Default.) + * 1 : Show SIGSEGV detail, even if a signal handler is present + #### BOX64_X11THREADS Call XInitThreads when loading X11. (This is mostly for old Loki games with the Loki_Compat library.) * 0 : Don't force call XInitThreads. (Default.) 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"); -- cgit 1.4.1