From 891ea8f74d2bfae4e1edc082544fedee3220d3da Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Thu, 27 May 2021 16:58:56 -0700 Subject: os: print if unw_is_signal_frame() libunwind has a function to query whether the cursor points to a signal frame. Use this to print 1: like GDB does, rather than printing something less useful such as 1: /usr/lib/libpthread.so.0 (funlockfile+0x60) [0x7f679838b870] Signed-off-by: Aaron Plattner (cherry picked from commit a73641937a9e0df3a5d32f0dac7114d971abcd21) --- os/backtrace.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/os/backtrace.c b/os/backtrace.c index 99d776950..bf7ee68e2 100644 --- a/os/backtrace.c +++ b/os/backtrace.c @@ -97,9 +97,14 @@ xorg_backtrace(void) else filename = "?"; - ErrorFSigSafe("%u: %s (%s%s+0x%x) [%p]\n", i++, filename, procname, - ret == -UNW_ENOMEM ? "..." : "", (int)off, - (void *)(uintptr_t)(ip)); + + if (unw_is_signal_frame(&cursor)) { + ErrorFSigSafe("%u: \n", i++); + } else { + ErrorFSigSafe("%u: %s (%s%s+0x%x) [%p]\n", i++, filename, procname, + ret == -UNW_ENOMEM ? "..." : "", (int)off, + (void *)(uintptr_t)(ip)); + } ret = unw_step(&cursor); if (ret < 0) -- cgit v1.2.3