Implement dt(4) utrace support on amd64 and i386.
authorclaudio <claudio@openbsd.org>
Wed, 26 Apr 2023 16:53:58 +0000 (16:53 +0000)
committerclaudio <claudio@openbsd.org>
Wed, 26 Apr 2023 16:53:58 +0000 (16:53 +0000)
commita28bb56f1e3b6564881b3d3de68367d380458694
tree449109960dd29916ce49805affcf896501be8f25
parent1fc2657f8f4c83a1a4f32c473d00f26e7c46058d
Implement dt(4) utrace support on amd64 and i386.

This adds stacktrace_save_utrace() to extract and save the userland stack
which is stubbed out on most archs. alpha and riscv64 do not even implement
dt(4) and stacktrace_save_at() so the stubs are excluded there.

Additionally add a new ioctl DTIOCGETAUXBASE which allows btrace to
fetch the AUX_BASE vallue from the AUX vector of a process.

OK mpi@ (some time ago) discussed with kettenis@
12 files changed:
sys/arch/amd64/amd64/db_trace.c
sys/arch/arm64/arm64/db_trace.c
sys/arch/hppa/hppa/db_interface.c
sys/arch/i386/i386/db_trace.c
sys/arch/mips64/mips64/trap.c
sys/arch/powerpc/ddb/db_trace.c
sys/arch/powerpc64/powerpc64/db_trace.c
sys/arch/sparc64/sparc64/db_trace.c
sys/dev/dt/dt_dev.c
sys/dev/dt/dt_prov_profile.c
sys/dev/dt/dtvar.h
sys/sys/stacktrace.h