]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use PT_GET_SC_ARGS and PT_GET_SC_RET in truss.
authorjhb <jhb@FreeBSD.org>
Tue, 16 Jul 2019 22:59:15 +0000 (22:59 +0000)
committerjhb <jhb@FreeBSD.org>
Tue, 16 Jul 2019 22:59:15 +0000 (22:59 +0000)
commitfa69965329392f6ce468a9cb28912a3df2874fab
tree7726a79675e6e690c1ae05c525742f80cafc7358
parent1f59bd994df817e71a8d608d873aed29b3fefa63
Use PT_GET_SC_ARGS and PT_GET_SC_RET in truss.

This removes all of the architecture-specific functions from truss.

A per-ABI structure is still needed to map syscall numbers to names
and FreeBSD errno values to ABI error values as well as hold syscall
counters.  However, the linker set of ABI structures is now replaced
with a simple table mapping ABI names to structures.  This approach
permits sharing the same ABI structure among separate names such as
i386 a.out and ELF binaries as well as ELF v1 vs ELF v2 for powerpc64.

A few differences are visible due to using PT_GET_SC_RET to fetch the
error value of a system call.  Note that ktrace/kdump have had the
"new" behaviors for a long time already:
- System calls that return with EJUSTRETURN or ERESTART will now be
  noticed and logged as such.  Previously sigreturn (which uses
  EJUSTRETURN) would report whatever random value was in the register
  holding errno from the previous system call for example.  Now it
  reports EJUSTRETURN.
- System calls that return errno as their error value such as
  posix_fallocate() and posix_fadvise() now report non-zero return
  values as errors instead of success with a non-zero return value.

Reviewed by: kib
MFC after: 1 month
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D20963
24 files changed:
usr.bin/truss/Makefile
usr.bin/truss/aarch64-cloudabi32.c [deleted file]
usr.bin/truss/aarch64-cloudabi64.c [deleted file]
usr.bin/truss/aarch64-freebsd.c [deleted file]
usr.bin/truss/amd64-cloudabi32.c [deleted file]
usr.bin/truss/amd64-cloudabi64.c [deleted file]
usr.bin/truss/amd64-freebsd.c [deleted file]
usr.bin/truss/amd64-freebsd32.c [deleted file]
usr.bin/truss/amd64-linux.c [deleted file]
usr.bin/truss/amd64-linux32.c [deleted file]
usr.bin/truss/arm-freebsd.c [deleted file]
usr.bin/truss/i386-cloudabi32.c [deleted file]
usr.bin/truss/i386-freebsd.c [deleted file]
usr.bin/truss/i386-linux.c [deleted file]
usr.bin/truss/mips-freebsd.c [deleted file]
usr.bin/truss/powerpc-freebsd.c [deleted file]
usr.bin/truss/powerpc64-freebsd.c [deleted file]
usr.bin/truss/powerpc64-freebsd32.c [deleted file]
usr.bin/truss/riscv-freebsd.c [deleted file]
usr.bin/truss/setup.c
usr.bin/truss/sparc64-freebsd.c [deleted file]
usr.bin/truss/syscall.h
usr.bin/truss/syscalls.c
usr.bin/truss/truss.h