Dmitry V. Levin
e3b80cb65f
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.
17 lines
348 B
C
17 lines
348 B
C
/*
|
|
* Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
|
|
* All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
|
*/
|
|
|
|
#ifndef STRACE_GET_PERSONALITY_H
|
|
#define STRACE_GET_PERSONALITY_H
|
|
|
|
#include "ptrace.h"
|
|
|
|
extern int
|
|
get_personality_from_syscall_info(const struct ptrace_syscall_info *);
|
|
|
|
#endif /* !STRACE_GET_PERSONALITY_H */
|