diff options
author | kib <kib@FreeBSD.org> | 2010-07-04 12:09:30 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-07-04 12:09:30 +0000 |
commit | af2d069e9b94cbf2f883170eaaa531ce37733214 (patch) | |
tree | 05f763cf84705143733cc32229dfe3defed128d2 /gnu | |
parent | 2b9a53839c45891fab833be19313b39fd70bdecb (diff) | |
download | FreeBSD-src-af2d069e9b94cbf2f883170eaaa531ce37733214.zip FreeBSD-src-af2d069e9b94cbf2f883170eaaa531ce37733214.tar.gz |
For "thread signal" command, print some information from siginfo when
available.
Suggested by: davidxu
MFC after: 2 weeks
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/gdb/libgdb/fbsd-threads.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c b/gnu/usr.bin/gdb/libgdb/fbsd-threads.c index eb83f2e..51890eb 100644 --- a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c +++ b/gnu/usr.bin/gdb/libgdb/fbsd-threads.c @@ -1299,6 +1299,7 @@ fbsd_thread_signal_cmd (char *exp, int from_tty) td_thrhandle_t th; td_thrinfo_t ti; td_err_e err; + const char *code; if (!fbsd_thread_active || !IS_THREAD(inferior_ptid)) return; @@ -1315,6 +1316,42 @@ fbsd_thread_signal_cmd (char *exp, int from_tty) fbsd_print_sigset(&ti.ti_sigmask); printf_filtered("signal pending:\n"); fbsd_print_sigset(&ti.ti_pending); + if (ti.ti_siginfo.si_signo != 0) { + printf_filtered("si_signo %d si_errno %d", ti.ti_siginfo.si_signo, + ti.ti_siginfo.si_errno); + if (ti.ti_siginfo.si_errno != 0) + printf_filtered(" (%s)", strerror(ti.ti_siginfo.si_errno)); + printf_filtered("\n"); + switch (ti.ti_siginfo.si_code) { + case SI_NOINFO: + code = "NOINFO"; + break; + case SI_USER: + code = "USER"; + break; + case SI_QUEUE: + code = "QUEUE"; + break; + case SI_TIMER: + code = "TIMER"; + break; + case SI_ASYNCIO: + code = "ASYNCIO"; + break; + case SI_MESGQ: + code = "MESGQ"; + break; + case SI_KERNEL: + code = "KERNEL"; + break; + default: + code = "UNKNOWN"; + break; + } + printf_filtered("si_code %s si_pid %d si_uid %d si_status %x si_addr %p\n", + code, ti.ti_siginfo.si_pid, ti.ti_siginfo.si_uid, ti.ti_siginfo.si_status, + ti.ti_siginfo.si_addr); + } } static int |