freebsd-skq/usr.bin/truss
jhb ca28498877 Add handling for non-native error values to libsysdecode.
Add two new functions, sysdecode_abi_to_freebsd_errno() and
sysdecode_freebsd_to_abi_errno(), which convert errno values between
the native FreeBSD ABI and other supported ABIs. Note that the
mappings are not necessarily perfect meaning in some cases multiple
errors in one ABI might map to a single error in another ABI. In that
case, the reverse mapping will return one of the errors that maps, but
which error is non-deterministic.

Change truss to always report the raw error value to the user but
use libsysdecode to map it to a native errno value that can be used
with strerror() to generate a description. Previously truss reported
the "converted" error value. Now the user will always see the exact
error value that the application sees.

Change kdump to report the truly raw error value to the user. Previously
kdump would report the absolute value of the raw error value (so for
Linux binaries it didn't output the FreeBSD error value, but the positive
value of the Linux error). Now it reports the real (i.e. negative) error
value for Linux binaries. Also, use libsysdecode to convert the native
FreeBSD error reported in the ktrace record to the raw error used by the
ABI. This means that the Linux ABI can now be handled directly in
ktrsysret() and removes the need for linux_ktrsysret().

Reviewed by:	bdrewery, kib
Helpful notes:	wblock (manpage)
Differential Revision:	https://reviews.freebsd.org/D5314
2016-02-23 20:00:55 +00:00
..
aarch64-cloudabi64.c Add handling for non-native error values to libsysdecode. 2016-02-23 20:00:55 +00:00
aarch64-freebsd.c Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. 2016-01-30 01:00:54 +00:00
amd64-cloudabi64.c Add handling for non-native error values to libsysdecode. 2016-02-23 20:00:55 +00:00
amd64-freebsd32.c Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. 2016-01-30 01:00:54 +00:00
amd64-freebsd.c Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. 2016-01-30 01:00:54 +00:00
amd64-linux32.c Add handling for non-native error values to libsysdecode. 2016-02-23 20:00:55 +00:00
arm-freebsd.c Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. 2016-01-30 01:00:54 +00:00
extern.h Add support for displaying thread IDs to truss(1). 2016-02-23 19:56:29 +00:00
i386-freebsd.c Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. 2016-01-30 01:00:54 +00:00
i386-linux.c Add handling for non-native error values to libsysdecode. 2016-02-23 20:00:55 +00:00
main.c Add support for displaying thread IDs to truss(1). 2016-02-23 19:56:29 +00:00
Makefile Add handling for non-native error values to libsysdecode. 2016-02-23 20:00:55 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2016-02-16 02:14:30 +00:00
makesyscallsconf.sh Simplify syscall generation and ABI source file handling for the build. 2015-10-13 18:23:51 +00:00
mips-freebsd.c Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. 2016-01-30 01:00:54 +00:00
powerpc64-freebsd32.c Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. 2016-01-30 01:00:54 +00:00
powerpc64-freebsd.c Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. 2016-01-30 01:00:54 +00:00
powerpc-freebsd.c Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. 2016-01-30 01:00:54 +00:00
setup.c Add support for displaying thread IDs to truss(1). 2016-02-23 19:56:29 +00:00
sparc64-freebsd.c Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. 2016-01-30 01:00:54 +00:00
syscall.h Fetch the current thread and it's syscall state from the trussinfo object 2016-02-16 22:00:01 +00:00
syscalls.c Add handling for non-native error values to libsysdecode. 2016-02-23 20:00:55 +00:00
truss.1 Add support for displaying thread IDs to truss(1). 2016-02-23 19:56:29 +00:00
truss.h Add support for displaying thread IDs to truss(1). 2016-02-23 19:56:29 +00:00