ddb: print the actual syscall name
authorMitchell Horne <mhorne@FreeBSD.org>
Fri, 28 Oct 2022 21:20:05 +0000 (18:20 -0300)
committerMitchell Horne <mhorne@FreeBSD.org>
Fri, 28 Oct 2022 21:21:08 +0000 (18:21 -0300)
commitaba921bd9e1869dae9ae4cc6e0c048f997401034
tree060c89fda95df1ed34028202425382cfeee86a79
parent1da65dcb1c57fae7be75ddf1bd300ddf19ced850
ddb: print the actual syscall name

Some architectures will pretty-print a system call trap in the
backtrace. Rather than printing the symbol, use the syscallname()
function to pull the string from the sv_syscallnames array corresponding
to the process. This simplifies the function somewhat.

Mostly, this will result in dropping the "sys" prefix, e.g. "sys_exit"
will now be printed simply as "exit".

Make two minor tweaks to the function signature: use a u_int for the
syscall number since this is a more correct type (see the 'code' member
of struct syscall_args), and make the thread pointer the first argument.
The latter is more natural and conventional.

Suggested by:   jrtc27
Reviewed by: jrtc27, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37200
sys/amd64/amd64/db_trace.c
sys/ddb/db_sym.c
sys/ddb/db_sym.h
sys/i386/i386/db_trace.c
sys/riscv/riscv/db_trace.c