os: print <signal handler called> if unw_is_signal_frame()

libunwind has a function to query whether the cursor points to a signal frame.
Use this to print

 1: <signal handler called>

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 <aplattner@nvidia.com>
This commit is contained in:
Aaron Plattner 2021-05-27 16:58:56 -07:00
parent 7cdcdfea08
commit a73641937a

View File

@ -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: <signal handler called>\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)