aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-10-09 10:17:22 -0400
committerFlorin Coras <florin.coras@gmail.com>2020-10-09 16:52:13 +0000
commit695eb9353dc4895a17d960488675b7e44c8022db (patch)
tree119db6942c2efed25ccc255b2860925a48aab717 /src
parentdd9eae5c29a4379943e60ddf6b7ab96b8e154040 (diff)
vlib: save signal handler data to global vbls
Turns out that clang is a bit too enthusiastic about mapping static variables to registers, which makes it hard to extract (especially) the faulting VA from an optimized core file. Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I836e5d9695aeb4c5ee4a27f9565acf08ee4eaac0
Diffstat (limited to 'src')
-rw-r--r--src/vlib/unix/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c
index 9dde666bbef..83a3a1f643b 100644
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -93,8 +93,8 @@ unsetup_signal_handlers (int sig)
dangerous to vec_resize it when crashing, mheap itself might have been
corrupted already */
static u8 *syslog_msg = 0;
-static int last_signum = 0;
-static uword last_faulting_address = 0;
+int vlib_last_signum = 0;
+uword vlib_last_faulting_address = 0;
static void
unix_signal_handler (int signum, siginfo_t * si, ucontext_t * uc)
@@ -102,8 +102,8 @@ unix_signal_handler (int signum, siginfo_t * si, ucontext_t * uc)
uword fatal = 0;
/* These come in handy when looking at core files from optimized images */
- last_signum = signum;
- last_faulting_address = (uword) si->si_addr;
+ vlib_last_signum = signum;
+ vlib_last_faulting_address = (uword) si->si_addr;
syslog_msg = format (syslog_msg, "received signal %U, PC %U",
format_signal, signum, format_ucontext_pc, uc);