diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-03-31 13:14:26 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-03-31 13:14:26 +0200 |
| commit | b7ab26073e59b1b0c0dbe639d29f6e175544bcfe (patch) | |
| tree | 17b2341e50c229762c99cc9ee49bd336472163ee /src | |
| parent | 1c3df4b92cd975687c466aed7b2d1e5a474aaa7d (diff) | |
| download | box64-b7ab26073e59b1b0c0dbe639d29f6e175544bcfe.tar.gz box64-b7ab26073e59b1b0c0dbe639d29f6e175544bcfe.zip | |
[TRACE] Do not print opcode at SIGBUS if x64pc or pc is not readable
Diffstat (limited to 'src')
| -rw-r--r-- | src/libtools/signals.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libtools/signals.c b/src/libtools/signals.c index b5b0313a..dd2ad7cc 100644 --- a/src/libtools/signals.c +++ b/src/libtools/signals.c @@ -2034,7 +2034,7 @@ dynarec_log(/*LOG_DEBUG*/LOG_INFO, "%04d|Repeated SIGSEGV with Access error on % } if(sig==SIGILL) { printf_log_prefix(0, log_minimum, " opcode=%02X %02X %02X %02X %02X %02X %02X %02X (%02X %02X %02X %02X %02X)\n", ((uint8_t*)pc)[0], ((uint8_t*)pc)[1], ((uint8_t*)pc)[2], ((uint8_t*)pc)[3], ((uint8_t*)pc)[4], ((uint8_t*)pc)[5], ((uint8_t*)pc)[6], ((uint8_t*)pc)[7], ((uint8_t*)x64pc)[0], ((uint8_t*)x64pc)[1], ((uint8_t*)x64pc)[2], ((uint8_t*)x64pc)[3], ((uint8_t*)x64pc)[4]); - } else if(sig==SIGBUS || (sig==SIGSEGV && (x64pc!=(uintptr_t)addr) && (pc!=addr))) { + } else if(sig==SIGBUS || (sig==SIGSEGV && (x64pc!=(uintptr_t)addr) && (pc!=addr)) && (getProtection_fast(x64pc)&PROT_READ) && (getProtection_fast((uintptr_t)pc)&PROT_READ)) { printf_log_prefix(0, log_minimum, " %sopcode=%02X %02X %02X %02X %02X %02X %02X %02X (opcode=%08x)\n", (emu->segs[_CS]==0x23)?"x86":"x64", ((uint8_t*)x64pc)[0], ((uint8_t*)x64pc)[1], ((uint8_t*)x64pc)[2], ((uint8_t*)x64pc)[3], ((uint8_t*)x64pc)[4], ((uint8_t*)x64pc)[5], ((uint8_t*)x64pc)[6], ((uint8_t*)x64pc)[7], *(uint32_t*)pc); } else { printf_log_prefix(0, log_minimum, "\n"); |