From e5e353c81dec431e27b0dad3442e71fc7d0f18f5 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sat, 19 Sep 2020 10:24:40 +0100 Subject: [PATCH] debug.c: NetBSD build warning fix. (#7810) The symbol base address is a const on this system. (cherry picked from commit eabe3eaec02e293d479c695bc973b8780c989da9) --- src/debug.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/debug.c b/src/debug.c index ae62c0216..0f8760ef6 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1638,13 +1638,14 @@ void sigsegvHandler(int sig, siginfo_t *info, void *secret) { /* Find the address of the next page, which is our "safety" * limit when dumping. Then try to dump just 128 bytes more * than EIP if there is room, or stop sooner. */ + void *base = (void *)info.dli_saddr; unsigned long next = ((unsigned long)eip + sz) & ~(sz-1); unsigned long end = (unsigned long)eip + 128; if (end > next) end = next; - len = end - (unsigned long)info.dli_saddr; + len = end - (unsigned long)base; serverLogHexDump(LL_WARNING, "dump of function", - info.dli_saddr ,len); - dumpX86Calls(info.dli_saddr,len); + base ,len); + dumpX86Calls(base,len); } } }