]> granicus.if.org Git - strace/commit
Introduce PTRACE_GET_SYSCALL_INFO support
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 21 Nov 2018 01:44:16 +0000 (01:44 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 13 Dec 2018 22:07:26 +0000 (22:07 +0000)
commite3b80cb65fd50c4e377a01e780b7a46ce4ebb2e7
tree540c5798b8ee13c21eb77dd715a9a1a1e0eb4f49
parent7488ce9e23f1915728c1d70fa584bc1108e2e584
Introduce PTRACE_GET_SYSCALL_INFO support

When PTRACE_GET_SYSCALL_INFO API works,
use it instead of traditional upeek/get_regs API.

Tested on x86_64 and x86.

* get_personality.c: New file.
* get_personality.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* linux/aarch64/arch_get_personality.c: New file.
* linux/powerpc64/arch_get_personality.c: Likewise.
* linux/riscv/arch_get_personality.c: Likewise.
* linux/s390x/arch_get_personality.c: Likewise.
* linux/sparc64/arch_get_personality.c: Likewise.
* linux/tile/arch_get_personality.c: Likewise.
* linux/x32/arch_get_personality.c: Likewise.
* linux/x86_64/arch_get_personality.c: Likewise.
* linux/check_scno.c: Likewise.
* linux/x32/check_scno.c: Likewise.
* Makefile.am (EXTRA_DIST): Add them.
* linux/ia64/arch_getrval2.c (getrval2): Invoke get_regs()
if ptrace_syscall_info is in use.
* linux/mips/arch_getrval2.c: Likewise.
* linux/sparc/arch_getrval2.c: Likewise.
* defs.h (get_personality_from_syscall_info): New prototype.
* syscall.c: Include "get_personality.h" and "ptrace_syscall_info.h".
(get_regs_error): Define unconditionally.
(ptrace_sci): New static variable.
(clear_regs): Reset ptrace_sci.op.
(ptrace_syscall_info_is_valid, ptrace_get_syscall_info,
get_syscall_regs): New functions.
(get_syscall_result_regs): Change to get_syscall_regs.
(get_instruction_pointer, get_stack_pointer, get_scno, get_syscall_args,
get_error, set_error, set_success): Add ptrace_syscall_info support.
* tests/int_0x80.test: New test.
* tests/Makefile.am (DECODER_TESTS): Add int_0x80.test.
(XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Remove.
* tests/gen_tests.in (int_0x80): Remove.
20 files changed:
Makefile.am
get_personality.c [new file with mode: 0644]
get_personality.h [new file with mode: 0644]
linux/aarch64/arch_get_personality.c [new file with mode: 0644]
linux/check_scno.c [new file with mode: 0644]
linux/ia64/arch_getrval2.c
linux/mips/arch_getrval2.c
linux/powerpc64/arch_get_personality.c [new file with mode: 0644]
linux/riscv/arch_get_personality.c [new file with mode: 0644]
linux/s390x/arch_get_personality.c [new file with mode: 0644]
linux/sparc/arch_getrval2.c
linux/sparc64/arch_get_personality.c [new file with mode: 0644]
linux/tile/arch_get_personality.c [new file with mode: 0644]
linux/x32/arch_get_personality.c [new file with mode: 0644]
linux/x32/check_scno.c [new file with mode: 0644]
linux/x86_64/arch_get_personality.c [new file with mode: 0644]
syscall.c
tests/Makefile.am
tests/gen_tests.in
tests/int_0x80.test [new file with mode: 0755]