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)
Fri, Apr 26, 10:45 PM
Unknown Object (File)
Fri, Apr 26, 10:45 PM
Unknown Object (File)
Fri, Apr 26, 10:45 PM
Unknown Object (File)
Fri, Apr 26, 8:45 PM
Unknown Object (File)
Mar 11 2024, 4:22 PM
Unknown Object (File)
Mar 10 2024, 11:27 PM
Unknown Object (File)
Mar 10 2024, 11:27 PM
Unknown Object (File)
Mar 10 2024, 10:51 PM
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.