Page MenuHomeFreeBSD

ddb: print the actual syscall name
ClosedPublic

Authored by mhorne on Oct 28 2022, 6:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 1, 11:29 AM
Unknown Object (File)
Wed, Jan 29, 4:31 PM
Unknown Object (File)
Sat, Jan 25, 10:51 AM
Unknown Object (File)
Sat, Jan 25, 3:46 AM
Unknown Object (File)
Thu, Jan 23, 2:04 PM
Unknown Object (File)
Jan 13 2025, 6:53 PM
Unknown Object (File)
Jan 10 2025, 9:03 AM
Unknown Object (File)
Dec 3 2024, 5:38 AM
Subscribers

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

The suggested follow-up to D36565. Arguably, db_decode_syscall() doesn't belong in this file anymore, despite the fact that I just moved it there. I will leave it unless we feel it should be moved once more.

This revision is now accepted and ready to land.Oct 28 2022, 6:26 PM

I think it still does kind of belong in db_sym.c FWIW.

This revision was automatically updated to reflect the committed changes.