From 4383640bfe4c40c055824d9c42ed8809bb3163b4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 31 May 2020 00:23:22 +0200 Subject: Print signal names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- sctrace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sctrace.c') 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); -- cgit v1.2.3-70-g09d2