1999-10-29 17:38:14 +00:00
|
|
|
/* `ptrace' debugger support interface. Linux/SPARC version.
|
2020-01-01 00:14:33 +00:00
|
|
|
Copyright (C) 1996-2020 Free Software Foundation, Inc.
|
1999-10-29 17:38:14 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1999-10-29 17:38:14 +00:00
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
1999-10-29 17:38:14 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
Prefer https to http for gnu.org and fsf.org URLs
Also, change sources.redhat.com to sourceware.org.
This patch was automatically generated by running the following shell
script, which uses GNU sed, and which avoids modifying files imported
from upstream:
sed -ri '
s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g
s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g
' \
$(find $(git ls-files) -prune -type f \
! -name '*.po' \
! -name 'ChangeLog*' \
! -path COPYING ! -path COPYING.LIB \
! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \
! -path manual/texinfo.tex ! -path scripts/config.guess \
! -path scripts/config.sub ! -path scripts/install-sh \
! -path scripts/mkinstalldirs ! -path scripts/move-if-change \
! -path INSTALL ! -path locale/programs/charmap-kw.h \
! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \
! '(' -name configure \
-execdir test -f configure.ac -o -f configure.in ';' ')' \
! '(' -name preconfigure \
-execdir test -f preconfigure.ac ';' ')' \
-print)
and then by running 'make dist-prepare' to regenerate files built
from the altered files, and then executing the following to cleanup:
chmod a+x sysdeps/unix/sysv/linux/riscv/configure
# Omit irrelevant whitespace and comment-only changes,
# perhaps from a slightly-different Autoconf version.
git checkout -f \
sysdeps/csky/configure \
sysdeps/hppa/configure \
sysdeps/riscv/configure \
sysdeps/unix/sysv/linux/csky/configure
# Omit changes that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines
git checkout -f \
sysdeps/powerpc/powerpc64/ppc-mcount.S \
sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
# Omit change that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline
git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
2019-09-07 05:40:42 +00:00
|
|
|
<https://www.gnu.org/licenses/>. */
|
1999-10-29 17:38:14 +00:00
|
|
|
|
|
|
|
#ifndef _SYS_PTRACE_H
|
|
|
|
#define _SYS_PTRACE_H 1
|
|
|
|
|
|
|
|
#include <features.h>
|
2013-07-04 07:45:12 +00:00
|
|
|
#include <bits/types.h>
|
1999-10-29 17:38:14 +00:00
|
|
|
#include <bits/wordsize.h>
|
|
|
|
|
|
|
|
/* Linux/SPARC kernels up to 2.3.18 do not care much
|
|
|
|
about what namespace polution, so use a kludge now. */
|
|
|
|
#undef PTRACE_GETREGS
|
|
|
|
#undef PTRACE_SETREGS
|
|
|
|
#undef PTRACE_GETFPREGS
|
|
|
|
#undef PTRACE_SETFPREGS
|
|
|
|
#undef PTRACE_READDATA
|
|
|
|
#undef PTRACE_WRITEDATA
|
|
|
|
#undef PTRACE_READTEXT
|
|
|
|
#undef PTRACE_WRITETEXT
|
|
|
|
#undef PTRACE_SUNDETACH
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
/* Type of the REQUEST argument to `ptrace.' */
|
|
|
|
enum __ptrace_request
|
|
|
|
{
|
|
|
|
/* Indicate that the process making this request should be traced.
|
|
|
|
All signals received by this process can be intercepted by its
|
|
|
|
parent, and its parent can use the other `ptrace' requests. */
|
|
|
|
PTRACE_TRACEME = 0,
|
|
|
|
#define PT_TRACE_ME PTRACE_TRACEME
|
|
|
|
|
|
|
|
/* Return the word in the process's text space at address ADDR. */
|
|
|
|
PTRACE_PEEKTEXT = 1,
|
|
|
|
#define PT_READ_I PTRACE_PEEKTEXT
|
|
|
|
|
|
|
|
/* Return the word in the process's data space at address ADDR. */
|
|
|
|
PTRACE_PEEKDATA = 2,
|
|
|
|
#define PT_READ_D PTRACE_PEEKDATA
|
|
|
|
|
|
|
|
/* Return the word in the process's user area at offset ADDR. */
|
|
|
|
PTRACE_PEEKUSER = 3,
|
|
|
|
#define PT_READ_U PTRACE_PEEKUSER
|
|
|
|
|
|
|
|
/* Write the word DATA into the process's text space at address ADDR. */
|
|
|
|
PTRACE_POKETEXT = 4,
|
|
|
|
#define PT_WRITE_I PTRACE_POKETEXT
|
|
|
|
|
|
|
|
/* Write the word DATA into the process's data space at address ADDR. */
|
|
|
|
PTRACE_POKEDATA = 5,
|
|
|
|
#define PT_WRITE_D PTRACE_POKEDATA
|
|
|
|
|
|
|
|
/* Write the word DATA into the process's user area at offset ADDR. */
|
|
|
|
PTRACE_POKEUSER = 6,
|
|
|
|
#define PT_WRITE_U PTRACE_POKEUSER
|
|
|
|
|
|
|
|
/* Continue the process. */
|
|
|
|
PTRACE_CONT = 7,
|
|
|
|
#define PT_CONTINUE PTRACE_CONT
|
|
|
|
|
|
|
|
/* Kill the process. */
|
|
|
|
PTRACE_KILL = 8,
|
|
|
|
#define PT_KILL PTRACE_KILL
|
|
|
|
|
2017-12-27 00:54:38 +00:00
|
|
|
/* Single step the process. */
|
1999-10-29 17:38:14 +00:00
|
|
|
PTRACE_SINGLESTEP = 9,
|
|
|
|
#define PT_STEP PTRACE_SINGLESTEP
|
|
|
|
|
|
|
|
/* Detach from a process attached to with PTRACE_ATTACH. */
|
|
|
|
PTRACE_DETACH = 11,
|
|
|
|
#define PT_DETACH PTRACE_DETACH
|
|
|
|
|
|
|
|
/* This define is needed for older programs which were
|
|
|
|
trying to work around sparc-linux ptrace nastiness. */
|
|
|
|
#define PTRACE_SUNDETACH PTRACE_DETACH
|
|
|
|
|
|
|
|
#if __WORDSIZE == 32
|
|
|
|
|
|
|
|
/* Get all general purpose registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
|
|
|
PTRACE_GETREGS = 12,
|
|
|
|
#define PT_GETREGS PTRACE_GETREGS
|
|
|
|
|
|
|
|
/* Set all general purpose registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
|
|
|
PTRACE_SETREGS = 13,
|
|
|
|
#define PT_SETREGS PTRACE_SETREGS
|
|
|
|
|
|
|
|
/* Get all floating point registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
|
|
|
PTRACE_GETFPREGS = 14,
|
|
|
|
#define PT_GETFPREGS PTRACE_GETFPREGS
|
|
|
|
|
|
|
|
/* Set all floating point registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
|
|
|
PTRACE_SETFPREGS = 15,
|
|
|
|
#define PT_SETFPREGS PTRACE_SETFPREGS
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Attach to a process that is already running. */
|
|
|
|
PTRACE_ATTACH = 16,
|
|
|
|
#define PT_ATTACH PTRACE_ATTACH
|
|
|
|
|
2000-03-21 21:07:30 +00:00
|
|
|
/* Write several bytes at a time. */
|
|
|
|
PTRACE_WRITEDATA = 17,
|
|
|
|
#define PTRACE_WRITEDATA PTRACE_WRITEDATA
|
|
|
|
|
1999-10-29 17:38:14 +00:00
|
|
|
/* Read several bytes at a time. */
|
|
|
|
PTRACE_READTEXT = 18,
|
2000-03-21 21:07:30 +00:00
|
|
|
#define PTRACE_READTEXT PTRACE_READTEXT
|
|
|
|
#define PTRACE_READDATA PTRACE_READTEXT
|
1999-10-29 17:38:14 +00:00
|
|
|
|
|
|
|
/* Write several bytes at a time. */
|
|
|
|
PTRACE_WRITETEXT = 19,
|
2000-03-21 21:07:30 +00:00
|
|
|
#define PTRACE_WRITETEXT PTRACE_WRITETEXT
|
1999-10-29 17:38:14 +00:00
|
|
|
|
|
|
|
#if __WORDSIZE == 64
|
|
|
|
|
|
|
|
/* Get all general purpose registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
|
|
|
PTRACE_GETREGS = 22,
|
|
|
|
#define PT_GETREGS PTRACE_GETREGS
|
|
|
|
|
|
|
|
/* Set all general purpose registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
|
|
|
PTRACE_SETREGS = 23,
|
|
|
|
#define PT_SETREGS PTRACE_SETREGS
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2017-12-27 00:54:38 +00:00
|
|
|
/* Continue and stop at the next entry to or return from syscall. */
|
* sysdeps/unix/sysv/linux/sys/ptrace.h (PT_GETEVENTMSG): Fix pasto.
* sysdeps/unix/sysv/linux/s390/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Likewise.
* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG): Likewise.
(PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Change to the arch independent
values.
* sysdeps/unix/sysv/linux/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
* sysdeps/unix/sysv/linux/ptrace.c (ptrace): Check PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO and PTRACE_SETSIGINFO.
2006-09-18 13:48:06 +00:00
|
|
|
PTRACE_SYSCALL = 24,
|
1999-10-29 17:38:14 +00:00
|
|
|
#define PTRACE_SYSCALL PTRACE_SYSCALL
|
|
|
|
|
|
|
|
#if __WORDSIZE == 64
|
|
|
|
|
|
|
|
/* Get all floating point registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
|
|
|
PTRACE_GETFPREGS = 25,
|
|
|
|
#define PT_GETFPREGS PTRACE_GETFPREGS
|
|
|
|
|
|
|
|
/* Set all floating point registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
* sysdeps/unix/sysv/linux/sys/ptrace.h (PT_GETEVENTMSG): Fix pasto.
* sysdeps/unix/sysv/linux/s390/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Likewise.
* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG): Likewise.
(PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Change to the arch independent
values.
* sysdeps/unix/sysv/linux/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
* sysdeps/unix/sysv/linux/ptrace.c (ptrace): Check PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO and PTRACE_SETSIGINFO.
2006-09-18 13:48:06 +00:00
|
|
|
PTRACE_SETFPREGS = 26,
|
1999-10-29 17:38:14 +00:00
|
|
|
#define PT_SETFPREGS PTRACE_SETFPREGS
|
|
|
|
|
|
|
|
#endif
|
* sysdeps/unix/sysv/linux/sys/ptrace.h (PT_GETEVENTMSG): Fix pasto.
* sysdeps/unix/sysv/linux/s390/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Likewise.
* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG): Likewise.
(PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Change to the arch independent
values.
* sysdeps/unix/sysv/linux/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
* sysdeps/unix/sysv/linux/ptrace.c (ptrace): Check PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO and PTRACE_SETSIGINFO.
2006-09-18 13:48:06 +00:00
|
|
|
|
|
|
|
/* Set ptrace filter options. */
|
|
|
|
PTRACE_SETOPTIONS = 0x4200,
|
|
|
|
#define PT_SETOPTIONS PTRACE_SETOPTIONS
|
|
|
|
|
|
|
|
/* Get last ptrace message. */
|
|
|
|
PTRACE_GETEVENTMSG = 0x4201,
|
|
|
|
#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
|
|
|
|
|
|
|
|
/* Get siginfo for process. */
|
|
|
|
PTRACE_GETSIGINFO = 0x4202,
|
|
|
|
#define PT_GETSIGINFO PTRACE_GETSIGINFO
|
|
|
|
|
|
|
|
/* Set new siginfo for process. */
|
2011-08-11 06:09:24 +00:00
|
|
|
PTRACE_SETSIGINFO = 0x4203,
|
* sysdeps/unix/sysv/linux/sys/ptrace.h (PT_GETEVENTMSG): Fix pasto.
* sysdeps/unix/sysv/linux/s390/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Likewise.
* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG): Likewise.
(PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Change to the arch independent
values.
* sysdeps/unix/sysv/linux/sys/ptrace.h (PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
* sysdeps/unix/sysv/linux/ptrace.c (ptrace): Check PTRACE_SETOPTIONS,
PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO and PTRACE_SETSIGINFO.
2006-09-18 13:48:06 +00:00
|
|
|
#define PT_SETSIGINFO PTRACE_SETSIGINFO
|
2011-07-23 23:10:18 +00:00
|
|
|
|
|
|
|
/* Get register content. */
|
|
|
|
PTRACE_GETREGSET = 0x4204,
|
|
|
|
#define PTRACE_GETREGSET PTRACE_GETREGSET
|
|
|
|
|
|
|
|
/* Set register content. */
|
|
|
|
PTRACE_SETREGSET = 0x4205,
|
|
|
|
#define PTRACE_SETREGSET PTRACE_SETREGSET
|
|
|
|
|
|
|
|
/* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
|
|
|
|
signal or group stop state. */
|
|
|
|
PTRACE_SEIZE = 0x4206,
|
|
|
|
#define PTRACE_SEIZE PTRACE_SEIZE
|
|
|
|
|
|
|
|
/* Trap seized tracee. */
|
|
|
|
PTRACE_INTERRUPT = 0x4207,
|
|
|
|
#define PTRACE_INTERRUPT PTRACE_INTERRUPT
|
|
|
|
|
|
|
|
/* Wait for next group event. */
|
2013-07-04 07:45:12 +00:00
|
|
|
PTRACE_LISTEN = 0x4208,
|
|
|
|
#define PTRACE_LISTEN PTRACE_LISTEN
|
|
|
|
|
2017-12-27 00:54:38 +00:00
|
|
|
/* Retrieve siginfo_t structures without removing signals from a queue. */
|
2016-01-12 12:42:55 +00:00
|
|
|
PTRACE_PEEKSIGINFO = 0x4209,
|
2013-07-04 07:45:12 +00:00
|
|
|
#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
|
2016-01-12 12:42:55 +00:00
|
|
|
|
2017-12-27 00:54:38 +00:00
|
|
|
/* Get the mask of blocked signals. */
|
2016-01-12 12:42:55 +00:00
|
|
|
PTRACE_GETSIGMASK = 0x420a,
|
|
|
|
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
|
|
|
|
|
2017-12-27 00:54:38 +00:00
|
|
|
/* Change the mask of blocked signals. */
|
2016-01-12 12:42:55 +00:00
|
|
|
PTRACE_SETSIGMASK = 0x420b,
|
|
|
|
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
|
|
|
|
|
2017-12-27 00:54:38 +00:00
|
|
|
/* Get seccomp BPF filters. */
|
2018-04-24 12:11:35 +00:00
|
|
|
PTRACE_SECCOMP_GET_FILTER = 0x420c,
|
2016-01-12 12:42:55 +00:00
|
|
|
#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
|
2018-04-24 12:11:35 +00:00
|
|
|
|
|
|
|
/* Get seccomp BPF filter metadata. */
|
2019-10-14 23:43:52 +00:00
|
|
|
PTRACE_SECCOMP_GET_METADATA = 0x420d,
|
2018-04-24 12:11:35 +00:00
|
|
|
#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
|
2019-10-14 23:43:52 +00:00
|
|
|
|
|
|
|
/* Get information about system call. */
|
|
|
|
PTRACE_GET_SYSCALL_INFO = 0x420e
|
|
|
|
#define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO
|
2011-07-23 23:10:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-12-27 00:54:38 +00:00
|
|
|
#include <bits/ptrace-shared.h>
|
1999-10-29 17:38:14 +00:00
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif /* _SYS_PTRACE_H */
|