From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12993 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] add bits/ptrace.h Date: Sun, 8 Jul 2018 15:16:54 +0200 Message-ID: <20180708131654.GD4418@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1531055703 17396 195.159.176.226 (8 Jul 2018 13:15:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 8 Jul 2018 13:15:03 +0000 (UTC) User-Agent: Mutt/1.9.1 (2017-09-22) To: musl@lists.openwall.com Original-X-From: musl-return-13009-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jul 08 15:14:59 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fc9Wk-0004QI-HN for gllmg-musl@m.gmane.org; Sun, 08 Jul 2018 15:14:58 +0200 Original-Received: (qmail 11416 invoked by uid 550); 8 Jul 2018 13:17:07 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 11383 invoked from network); 8 Jul 2018 13:17:06 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline Xref: news.gmane.org gmane.linux.lib.musl.general:12993 Archived-At: sys/ptrace.h is target specific, use bits/ptrace.h to add target specific macro definitions. these macros are kept in the generic sys/ptrace.h even though some targets don't support them: PTRACE_GETREGS PTRACE_SETREGS PTRACE_GETFPREGS PTRACE_SETFPREGS PTRACE_GETFPXREGS PTRACE_SETFPXREGS so no macro definition got removed in this patch on any target. only s390x has a numerically conflicting macro definition (PTRACE_SINGLEBLOCK). the PT_ aliases follow glibc headers, otherwise the definitions come from linux uapi headers except ones that are skipped in glibc and there is no real kernel support (s390x PTRACE_*_AREA) or need special type definitions (mips PTRACE_*_WATCH_*) or only relevant for linux 2.4 compatibility (PTRACE_OLDSETOPTIONS). --- arch/generic/bits/ptrace.h | 0 arch/i386/bits/ptrace.h | 11 +++++++++++ arch/m68k/bits/ptrace.h | 2 ++ arch/mips/bits/ptrace.h | 9 +++++++++ arch/mips64/bits/ptrace.h | 9 +++++++++ arch/mipsn32/bits/ptrace.h | 9 +++++++++ arch/powerpc/bits/ptrace.h | 23 +++++++++++++++++++++++ arch/powerpc64/bits/ptrace.h | 23 +++++++++++++++++++++++ arch/s390x/bits/ptrace.h | 9 +++++++++ arch/x32/bits/ptrace.h | 13 +++++++++++++ arch/x86_64/bits/ptrace.h | 13 +++++++++++++ include/sys/ptrace.h | 2 ++ 12 files changed, 123 insertions(+) create mode 100644 arch/generic/bits/ptrace.h create mode 100644 arch/i386/bits/ptrace.h create mode 100644 arch/m68k/bits/ptrace.h create mode 100644 arch/mips/bits/ptrace.h create mode 100644 arch/mips64/bits/ptrace.h create mode 100644 arch/mipsn32/bits/ptrace.h create mode 100644 arch/powerpc/bits/ptrace.h create mode 100644 arch/powerpc64/bits/ptrace.h create mode 100644 arch/s390x/bits/ptrace.h create mode 100644 arch/x32/bits/ptrace.h create mode 100644 arch/x86_64/bits/ptrace.h diff --git a/arch/generic/bits/ptrace.h b/arch/generic/bits/ptrace.h new file mode 100644 index 00000000..e69de29b diff --git a/arch/i386/bits/ptrace.h b/arch/i386/bits/ptrace.h new file mode 100644 index 00000000..7d0efbf3 --- /dev/null +++ b/arch/i386/bits/ptrace.h @@ -0,0 +1,11 @@ +#define PTRACE_GET_THREAD_AREA 25 +#define PTRACE_SET_THREAD_AREA 26 +#define PTRACE_SYSEMU 31 +#define PTRACE_SYSEMU_SINGLESTEP 32 +#define PTRACE_SINGLEBLOCK 33 + +#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA +#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA +#define PT_SYSEMU PTRACE_SYSEMU +#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP +#define PT_STEPBLOCK PTRACE_SINGLEBLOCK diff --git a/arch/m68k/bits/ptrace.h b/arch/m68k/bits/ptrace.h new file mode 100644 index 00000000..da93e7a7 --- /dev/null +++ b/arch/m68k/bits/ptrace.h @@ -0,0 +1,2 @@ +#define PTRACE_GET_THREAD_AREA 25 +#define PTRACE_SINGLEBLOCK 33 diff --git a/arch/mips/bits/ptrace.h b/arch/mips/bits/ptrace.h new file mode 100644 index 00000000..77a01c06 --- /dev/null +++ b/arch/mips/bits/ptrace.h @@ -0,0 +1,9 @@ +#define PTRACE_GET_THREAD_AREA 25 +#define PTRACE_SET_THREAD_AREA 26 +#define PTRACE_PEEKTEXT_3264 0xc0 +#define PTRACE_PEEKDATA_3264 0xc1 +#define PTRACE_POKETEXT_3264 0xc2 +#define PTRACE_POKEDATA_3264 0xc3 +#define PTRACE_GET_THREAD_AREA_3264 0xc4 +#define PTRACE_GET_WATCH_REGS 0xd0 +#define PTRACE_SET_WATCH_REGS 0xd1 diff --git a/arch/mips64/bits/ptrace.h b/arch/mips64/bits/ptrace.h new file mode 100644 index 00000000..77a01c06 --- /dev/null +++ b/arch/mips64/bits/ptrace.h @@ -0,0 +1,9 @@ +#define PTRACE_GET_THREAD_AREA 25 +#define PTRACE_SET_THREAD_AREA 26 +#define PTRACE_PEEKTEXT_3264 0xc0 +#define PTRACE_PEEKDATA_3264 0xc1 +#define PTRACE_POKETEXT_3264 0xc2 +#define PTRACE_POKEDATA_3264 0xc3 +#define PTRACE_GET_THREAD_AREA_3264 0xc4 +#define PTRACE_GET_WATCH_REGS 0xd0 +#define PTRACE_SET_WATCH_REGS 0xd1 diff --git a/arch/mipsn32/bits/ptrace.h b/arch/mipsn32/bits/ptrace.h new file mode 100644 index 00000000..77a01c06 --- /dev/null +++ b/arch/mipsn32/bits/ptrace.h @@ -0,0 +1,9 @@ +#define PTRACE_GET_THREAD_AREA 25 +#define PTRACE_SET_THREAD_AREA 26 +#define PTRACE_PEEKTEXT_3264 0xc0 +#define PTRACE_PEEKDATA_3264 0xc1 +#define PTRACE_POKETEXT_3264 0xc2 +#define PTRACE_POKEDATA_3264 0xc3 +#define PTRACE_GET_THREAD_AREA_3264 0xc4 +#define PTRACE_GET_WATCH_REGS 0xd0 +#define PTRACE_SET_WATCH_REGS 0xd1 diff --git a/arch/powerpc/bits/ptrace.h b/arch/powerpc/bits/ptrace.h new file mode 100644 index 00000000..75086ca0 --- /dev/null +++ b/arch/powerpc/bits/ptrace.h @@ -0,0 +1,23 @@ +#define PTRACE_GETVRREGS 0x12 +#define PTRACE_SETVRREGS 0x13 +#define PTRACE_GETEVRREGS 0x14 +#define PTRACE_SETEVRREGS 0x15 +#define PTRACE_GETREGS64 0x16 +#define PTRACE_SETREGS64 0x17 +#define PTRACE_GET_DEBUGREG 0x19 +#define PTRACE_SET_DEBUGREG 0x1a +#define PTRACE_GETVSRREGS 0x1b +#define PTRACE_SETVSRREGS 0x1c +#define PTRACE_SINGLEBLOCK 0x100 + +#define PT_GETVRREGS PTRACE_GETVRREGS +#define PT_SETVRREGS PTRACE_SETVRREGS +#define PT_GETEVRREGS PTRACE_GETEVRREGS +#define PT_SETEVRREGS PTRACE_SETEVRREGS +#define PT_GETREGS64 PTRACE_GETREGS64 +#define PT_SETREGS64 PTRACE_SETREGS64 +#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG +#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG +#define PT_GETVSRREGS PTRACE_GETVSRREGS +#define PT_SETVSRREGS PTRACE_SETVSRREGS +#define PT_STEPBLOCK PTRACE_SINGLEBLOCK diff --git a/arch/powerpc64/bits/ptrace.h b/arch/powerpc64/bits/ptrace.h new file mode 100644 index 00000000..75086ca0 --- /dev/null +++ b/arch/powerpc64/bits/ptrace.h @@ -0,0 +1,23 @@ +#define PTRACE_GETVRREGS 0x12 +#define PTRACE_SETVRREGS 0x13 +#define PTRACE_GETEVRREGS 0x14 +#define PTRACE_SETEVRREGS 0x15 +#define PTRACE_GETREGS64 0x16 +#define PTRACE_SETREGS64 0x17 +#define PTRACE_GET_DEBUGREG 0x19 +#define PTRACE_SET_DEBUGREG 0x1a +#define PTRACE_GETVSRREGS 0x1b +#define PTRACE_SETVSRREGS 0x1c +#define PTRACE_SINGLEBLOCK 0x100 + +#define PT_GETVRREGS PTRACE_GETVRREGS +#define PT_SETVRREGS PTRACE_SETVRREGS +#define PT_GETEVRREGS PTRACE_GETEVRREGS +#define PT_SETEVRREGS PTRACE_SETEVRREGS +#define PT_GETREGS64 PTRACE_GETREGS64 +#define PT_SETREGS64 PTRACE_SETREGS64 +#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG +#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG +#define PT_GETVSRREGS PTRACE_GETVSRREGS +#define PT_SETVSRREGS PTRACE_SETVSRREGS +#define PT_STEPBLOCK PTRACE_SINGLEBLOCK diff --git a/arch/s390x/bits/ptrace.h b/arch/s390x/bits/ptrace.h new file mode 100644 index 00000000..d50e3262 --- /dev/null +++ b/arch/s390x/bits/ptrace.h @@ -0,0 +1,9 @@ +#define PTRACE_SINGLEBLOCK 12 +#define PTRACE_PEEKUSR_AREA 0x5000 +#define PTRACE_POKEUSR_AREA 0x5001 +#define PTRACE_GET_LAST_BREAK 0x5006 +#define PTRACE_ENABLE_TE 0x5009 +#define PTRACE_DISABLE_TE 0x5010 +#define PTRACE_TE_ABORT_RAND 0x5011 + +#define PT_STEPBLOCK PTRACE_SINGLEBLOCK diff --git a/arch/x32/bits/ptrace.h b/arch/x32/bits/ptrace.h new file mode 100644 index 00000000..7f8a09b5 --- /dev/null +++ b/arch/x32/bits/ptrace.h @@ -0,0 +1,13 @@ +#define PTRACE_GET_THREAD_AREA 25 +#define PTRACE_SET_THREAD_AREA 26 +#define PTRACE_ARCH_PRCTL 30 +#define PTRACE_SYSEMU 31 +#define PTRACE_SYSEMU_SINGLESTEP 32 +#define PTRACE_SINGLEBLOCK 33 + +#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA +#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA +#define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL +#define PT_SYSEMU PTRACE_SYSEMU +#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP +#define PT_STEPBLOCK PTRACE_SINGLEBLOCK diff --git a/arch/x86_64/bits/ptrace.h b/arch/x86_64/bits/ptrace.h new file mode 100644 index 00000000..7f8a09b5 --- /dev/null +++ b/arch/x86_64/bits/ptrace.h @@ -0,0 +1,13 @@ +#define PTRACE_GET_THREAD_AREA 25 +#define PTRACE_SET_THREAD_AREA 26 +#define PTRACE_ARCH_PRCTL 30 +#define PTRACE_SYSEMU 31 +#define PTRACE_SYSEMU_SINGLESTEP 32 +#define PTRACE_SINGLEBLOCK 33 + +#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA +#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA +#define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL +#define PT_SYSEMU PTRACE_SYSEMU +#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP +#define PT_STEPBLOCK PTRACE_SINGLEBLOCK diff --git a/include/sys/ptrace.h b/include/sys/ptrace.h index 114185fd..229e1f3d 100644 --- a/include/sys/ptrace.h +++ b/include/sys/ptrace.h @@ -88,6 +88,8 @@ extern "C" { #define PTRACE_PEEKSIGINFO_SHARED 1 +#include + struct __ptrace_peeksiginfo_args { uint64_t off; uint32_t flags; -- 2.16.3