summaryrefslogtreecommitdiffstats
path: root/src/vlib/unix/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/unix/main.c')
-rwxr-xr-xsrc/vlib/unix/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c
index 08f0506fbc2..bf66407f0be 100755
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -88,12 +88,18 @@ unsetup_signal_handlers (int sig)
dangerous to vec_resize it when crashing, mheap itself might have been
corruptted already */
static u8 *syslog_msg = 0;
+static int last_signum = 0;
+static uword last_faulting_address = 0;
static void
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;
+
syslog_msg = format (syslog_msg, "received signal %U, PC %U",
format_signal, signum, format_ucontext_pc, uc);