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)
Oct 21 2024, 1:54 PM
Unknown Object (File)
Oct 3 2024, 11:53 PM
Unknown Object (File)
Oct 3 2024, 3:03 PM
Unknown Object (File)
Oct 3 2024, 1:05 PM
Unknown Object (File)
Oct 1 2024, 12:16 PM
Unknown Object (File)
Sep 30 2024, 2:20 AM
Unknown Object (File)
Sep 30 2024, 2:20 AM
Unknown Object (File)
Sep 30 2024, 12:23 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.