1996-02-19 23:14:44 +00:00
|
|
|
/* `ptrace' debugger support interface. Linux version.
|
2022-01-01 18:54:23 +00:00
|
|
|
Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
2017-12-27 00:54:38 +00:00
|
|
|
|
1996-11-15 04:08:00 +00:00
|
|
|
This file is part of the GNU C Library.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1996-11-15 04:08:00 +00:00
|
|
|
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.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1996-11-15 04:08:00 +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.
|
1995-02-18 01:27:10 +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/>. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1996-02-19 23:14:44 +00:00
|
|
|
#ifndef _SYS_PTRACE_H
|
1996-12-10 03:08:06 +00:00
|
|
|
#define _SYS_PTRACE_H 1
|
Update.
1998-10-02 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/unix/sysv/linux/sys/swap.h (SWAP_FLAG_PREFER,
SWAP_FLAG_PRIO_MASK,SWAP_FLAG_PRIO_SHIFT): Added.
Remove inclusion of <linux/swap.h>.
1998-10-05 Ulrich Drepper <drepper@cygnus.com>
* io/sys/stat.h: Use __P in definitions of inline stat functions
so that they match the declaration.
1998-10-02 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/unix/sysv/linux/sys/quota.h (Q_RSQUASH): Added.
1998-10-02 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/unix/sysv/linux/sys/acct.h: Bring in sync with current
linux 2.1 version.
1998-10-02 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/dl-machine.h: Fix typo in last change.
* sysdeps/arm/bits/huge_val.h: New file.
1998-10-02 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/unix/sysv/linux/sys/reboot.h (RB_POWER_OFF): Added.
* sysdeps/unix/sysv/linux/sys/ptrace.h (PTRACE_SYSCALL): Add
define.
1998-10-05 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/posix/getcwd.c (__getcwd): Use temporary variable to
store result of realloc instead of using BUF.
1998-10-04 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* misc/sgtty.h (_SGTTY_H): Correct spelling.
Reported by Rouben Rostamian <rostamian@umbc.edu> [PR libc/817].
1998-10-04 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* manual/memory.texi (Obstacks): Document
obstack_alloc_failed_handler usage.
* malloc/obstack.h: Enhance comment about
obstack_alloc_failed_handler usage.
* malloc/obstack.c: Likewise.
1998-10-05 Ulrich Drepper <drepper@cygnus.com>
* misc/sys/cdefs.h (__extension__): Define as empty if no gcc or
gcc before 2.8 is used.
1998-10-01 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/machine-gmon.h: Correct args to mcount(). Patch
from Scott Bambrough.
* sysdeps/unix/sysv/linux/arm/register-dump.h: New file.
* libio/libioP.h (FILEBUF_LITERAL) [! _IO_MTSAFE_IO]: Don't
include the lock member.
1998-09-03 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/fpu/__longjmp.S: Cope with fussy assembler.
1998-09-29 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* string/bits/string2.h (__string2_1bptr_p): Don't use a statement
expression.
(__mempcpy, strcpy, __stpcpy, strcmp, strcspn, strspn, strpbrk,
__strsep): Greatly reduce size of expansion by combining common
expressions.
(__mempcpy_small, __strcpy_small, __stpcpy_small): Convert to
inline function.
(__mempcpy_args, __strcpy_args, __stpcpy_args): New macros, used
by the above definitions.
1998-09-27 Geoff Keating <geoffk@ozemail.com.au>
* sysdeps/unix/sysv/linux/powerpc/bits/ipc.h: New file, use
correct struct ipc_perm definition.
1998-09-29 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
* nis/ypclnt.c (yp_all): Close UDP socket und give CLIENT handle free.
* sysdeps/unix/sysv/linux/alpha/ioperm.c: List Ruffian in platforms[].
* sysdeps/unix/sysv/linux/net/if_shaper.h: New file.
1998-10-05 13:40:47 +00:00
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
#include <features.h>
|
2013-07-04 07:45:12 +00:00
|
|
|
#include <bits/types.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
__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. */
|
1998-06-09 18:24:13 +00:00
|
|
|
PTRACE_PEEKTEXT = 1,
|
1995-02-18 01:27:10 +00:00
|
|
|
#define PT_READ_I PTRACE_PEEKTEXT
|
|
|
|
|
|
|
|
/* Return the word in the process's data space at address ADDR. */
|
1998-06-09 18:24:13 +00:00
|
|
|
PTRACE_PEEKDATA = 2,
|
1995-02-18 01:27:10 +00:00
|
|
|
#define PT_READ_D PTRACE_PEEKDATA
|
|
|
|
|
|
|
|
/* Return the word in the process's user area at offset ADDR. */
|
1998-06-09 18:24:13 +00:00
|
|
|
PTRACE_PEEKUSER = 3,
|
1995-02-18 01:27:10 +00:00
|
|
|
#define PT_READ_U PTRACE_PEEKUSER
|
|
|
|
|
|
|
|
/* Write the word DATA into the process's text space at address ADDR. */
|
1998-06-09 18:24:13 +00:00
|
|
|
PTRACE_POKETEXT = 4,
|
1995-02-18 01:27:10 +00:00
|
|
|
#define PT_WRITE_I PTRACE_POKETEXT
|
|
|
|
|
|
|
|
/* Write the word DATA into the process's data space at address ADDR. */
|
1998-06-09 18:24:13 +00:00
|
|
|
PTRACE_POKEDATA = 5,
|
1995-02-18 01:27:10 +00:00
|
|
|
#define PT_WRITE_D PTRACE_POKEDATA
|
|
|
|
|
1996-02-19 23:14:44 +00:00
|
|
|
/* Write the word DATA into the process's user area at offset ADDR. */
|
1998-06-09 18:24:13 +00:00
|
|
|
PTRACE_POKEUSER = 6,
|
1995-02-18 01:27:10 +00:00
|
|
|
#define PT_WRITE_U PTRACE_POKEUSER
|
|
|
|
|
|
|
|
/* Continue the process. */
|
1998-06-09 18:24:13 +00:00
|
|
|
PTRACE_CONT = 7,
|
1995-02-18 01:27:10 +00:00
|
|
|
#define PT_CONTINUE PTRACE_CONT
|
|
|
|
|
|
|
|
/* Kill the process. */
|
1998-06-09 18:24:13 +00:00
|
|
|
PTRACE_KILL = 8,
|
1995-02-18 01:27:10 +00:00
|
|
|
#define PT_KILL PTRACE_KILL
|
|
|
|
|
2017-12-27 00:54:38 +00:00
|
|
|
/* Single step the process. */
|
1998-06-09 18:24:13 +00:00
|
|
|
PTRACE_SINGLESTEP = 9,
|
1995-02-18 01:27:10 +00:00
|
|
|
#define PT_STEP PTRACE_SINGLESTEP
|
|
|
|
|
1998-06-09 18:24:13 +00:00
|
|
|
/* Get all general purpose registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
2017-12-27 00:54:38 +00:00
|
|
|
PTRACE_GETREGS = 12,
|
1998-06-09 18:24:13 +00:00
|
|
|
#define PT_GETREGS PTRACE_GETREGS
|
|
|
|
|
|
|
|
/* Set all general purpose registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
2017-12-27 00:54:38 +00:00
|
|
|
PTRACE_SETREGS = 13,
|
1998-06-09 18:24:13 +00:00
|
|
|
#define PT_SETREGS PTRACE_SETREGS
|
|
|
|
|
|
|
|
/* Get all floating point registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
2017-12-27 00:54:38 +00:00
|
|
|
PTRACE_GETFPREGS = 14,
|
1998-06-09 18:24:13 +00:00
|
|
|
#define PT_GETFPREGS PTRACE_GETFPREGS
|
|
|
|
|
|
|
|
/* Set all floating point registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
2017-12-27 00:54:38 +00:00
|
|
|
PTRACE_SETFPREGS = 15,
|
1998-06-09 18:24:13 +00:00
|
|
|
#define PT_SETFPREGS PTRACE_SETFPREGS
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
/* Attach to a process that is already running. */
|
1998-06-09 18:24:13 +00:00
|
|
|
PTRACE_ATTACH = 16,
|
1995-02-18 01:27:10 +00:00
|
|
|
#define PT_ATTACH PTRACE_ATTACH
|
|
|
|
|
|
|
|
/* Detach from a process attached to with PTRACE_ATTACH. */
|
1998-06-09 18:24:13 +00:00
|
|
|
PTRACE_DETACH = 17,
|
1995-02-18 01:27:10 +00:00
|
|
|
#define PT_DETACH PTRACE_DETACH
|
|
|
|
|
2000-06-24 07:08:49 +00:00
|
|
|
/* Get all extended floating point registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
2017-12-27 00:54:38 +00:00
|
|
|
PTRACE_GETFPXREGS = 18,
|
2000-06-24 07:08:49 +00:00
|
|
|
#define PT_GETFPXREGS PTRACE_GETFPXREGS
|
|
|
|
|
|
|
|
/* Set all extended floating point registers used by a processes.
|
|
|
|
This is not supported on all machines. */
|
2017-12-27 00:54:38 +00:00
|
|
|
PTRACE_SETFPXREGS = 19,
|
2000-06-24 07:08:49 +00:00
|
|
|
#define PT_SETFPXREGS PTRACE_SETFPXREGS
|
|
|
|
|
2017-12-27 00:54:38 +00:00
|
|
|
/* Continue and stop at the next entry to or return from syscall. */
|
2006-09-17 16:06:42 +00:00
|
|
|
PTRACE_SYSCALL = 24,
|
2000-07-06 16:58:19 +00:00
|
|
|
#define PT_SYSCALL PTRACE_SYSCALL
|
2006-09-17 16:06:42 +00:00
|
|
|
|
|
|
|
/* Set ptrace filter options. */
|
|
|
|
PTRACE_SETOPTIONS = 0x4200,
|
|
|
|
#define PT_SETOPTIONS PTRACE_SETOPTIONS
|
|
|
|
|
|
|
|
/* Get last ptrace message. */
|
|
|
|
PTRACE_GETEVENTMSG = 0x4201,
|
* 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_GETEVENTMSG PTRACE_GETEVENTMSG
|
2006-09-17 16:06:42 +00:00
|
|
|
|
|
|
|
/* Get siginfo for process. */
|
|
|
|
PTRACE_GETSIGINFO = 0x4202,
|
|
|
|
#define PT_GETSIGINFO PTRACE_GETSIGINFO
|
|
|
|
|
|
|
|
/* Set new siginfo for process. */
|
2011-07-23 23:10:18 +00:00
|
|
|
PTRACE_SETSIGINFO = 0x4203,
|
2006-09-17 16:06:42 +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. */
|
2021-08-09 16:51:38 +00:00
|
|
|
PTRACE_GET_SYSCALL_INFO = 0x420e,
|
2019-10-14 23:43:52 +00:00
|
|
|
#define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO
|
2021-08-09 16:51:38 +00:00
|
|
|
|
|
|
|
/* Get rseq configuration information. */
|
|
|
|
PTRACE_GET_RSEQ_CONFIGURATION = 0x420f
|
|
|
|
#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION
|
1995-02-18 01:27:10 +00:00
|
|
|
};
|
|
|
|
|
[BZ #4125]
* sysdeps/unix/sysv/linux/sys/ptrace.h
(PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK,
PTRACE_O_TRACEVFORK, PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC,
PTRACE_O_TRACEVFORKDONE, PTRACE_O_TRACEEXIT, PTRACE_O_MASK,
PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK, PTRACE_EVENT_CLONE,
PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE, PTRACE_EVENT_EXIT):
Define.
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/s390/sys/ptrace.h: Likewise.
2007-06-16 Andreas Jaeger <aj@suse.de>
[BZ #4125]
* sysdeps/unix/sysv/linux/sys/ptrace.h
(PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK,
PTRACE_O_TRACEVFORK, PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC,
PTRACE_O_TRACEVFORKDONE, PTRACE_O_TRACEEXIT, PTRACE_O_MASK,
PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK, PTRACE_EVENT_CLONE,
PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE, PTRACE_EVENT_EXIT):
Define.
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/s390/sys/ptrace.h: Likewise.
2007-06-17 17:29:48 +00:00
|
|
|
|
2017-12-27 00:54:38 +00:00
|
|
|
#include <bits/ptrace-shared.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
1996-12-10 03:08:06 +00:00
|
|
|
#endif /* _SYS_PTRACE_H */
|