aboutsummaryrefslogtreecommitdiffstats
path: root/sctrace.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-05-31 00:23:22 +0200
committerMattias Andrée <maandree@kth.se>2020-05-31 00:23:22 +0200
commit4383640bfe4c40c055824d9c42ed8809bb3163b4 (patch)
treedf194cbc3764320a88e25e1f77855aaaed4631ea /sctrace.c
parentWork around valgrind issue (diff)
downloadsctrace-4383640bfe4c40c055824d9c42ed8809bb3163b4.tar.gz
sctrace-4383640bfe4c40c055824d9c42ed8809bb3163b4.tar.bz2
sctrace-4383640bfe4c40c055824d9c42ed8809bb3163b4.tar.xz
Print signal names
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'sctrace.c')
-rw-r--r--sctrace.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sctrace.c b/sctrace.c
index 970d6c4..75b5507 100644
--- a/sctrace.c
+++ b/sctrace.c
@@ -216,8 +216,8 @@ have_outfp:
}
} else if (WIFSIGNALED(status)) {
- tprintf(proc, "\nProcess terminated by signal %i (%s)\n", WTERMSIG(status), strsignal(WTERMSIG(status)));
- /* TODO print signal name */
+ tprintf(proc, "\nProcess terminated by signal %i (%s: %s)\n", WTERMSIG(status),
+ get_signum_name(WTERMSIG(status)), strsignal(WTERMSIG(status)));
} else if (WIFSTOPPED(status)) {
if (WSTOPSIG(status) == (SIGTRAP | 0x80)) {
@@ -268,8 +268,8 @@ have_outfp:
}
} else {
print_signal:
- tprintf(proc, "\nProcess stopped by signal %i (%s)\n", WSTOPSIG(status), strsignal(WSTOPSIG(status)));
- /* TODO print signal name */
+ tprintf(proc, "\nProcess stopped by signal %i (%s: %s)\n", WSTOPSIG(status),
+ get_signum_name(WSTOPSIG(status)), strsignal(WSTOPSIG(status)));
/* TODO handle signals properly */
if (ptrace(PTRACE_SYSCALL, proc->pid, NULL, 0))
eprintf("ptrace PTRACE_SYSCALL %ju NULL 0", (uintmax_t)proc->pid);