From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121272 invoked by alias); 18 Jul 2017 10:20:45 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 121256 invoked by uid 89); 18 Jul 2017 10:20:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=upset, REQUEST, 57PM, 57pm X-HELO: vmicros1.altlinux.org Date: Tue, 18 Jul 2017 10:20:00 -0000 From: "Dmitry V. Levin" To: Stefan Liebler Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] S390: Sync ptrace.h with kernel. [BZ #21539] Message-ID: <20170718102039.GA20971@altlinux.org> Mail-Followup-To: Stefan Liebler , libc-alpha@sourceware.org References: <20170613200522.GA14306@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline In-Reply-To: X-SW-Source: 2017-07/txt/msg00627.txt.bz2 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 6853 On Mon, Jun 19, 2017 at 03:10:57PM +0200, Stefan Liebler wrote: [...] > --- a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h > +++ b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h > @@ -89,25 +89,9 @@ enum __ptrace_request > PTRACE_SINGLESTEP =3D 9, > #define PT_STEP PTRACE_SINGLESTEP >=20=20 > - /* Get all general purpose registers used by a processes. > - This is not supported on all machines. */ > - PTRACE_GETREGS =3D 12, > -#define PT_GETREGS PTRACE_GETREGS > - > - /* Set all general purpose registers used by a processes. > - This is not supported on all machines. */ > - PTRACE_SETREGS =3D 13, > -#define PT_SETREGS PTRACE_SETREGS > - > - /* Get all floating point registers used by a processes. > - This is not supported on all machines. */ > - PTRACE_GETFPREGS =3D 14, > -#define PT_GETFPREGS PTRACE_GETFPREGS > - > - /* Set all floating point registers used by a processes. > - This is not supported on all machines. */ > - PTRACE_SETFPREGS =3D 15, > -#define PT_SETFPREGS PTRACE_SETFPREGS > + /* Execute process until next taken branch. */ > + PTRACE_SINGLEBLOCK =3D 12, > +#define PT_STEPBLOCK PTRACE_SINGLEBLOCK >=20=20 > /* Attach to a process that is already running. */ > PTRACE_ATTACH =3D 16, > @@ -167,8 +151,26 @@ enum __ptrace_request > PTRACE_SETSIGMASK =3D 0x420b, > #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK >=20=20 > - PTRACE_SECCOMP_GET_FILTER =3D 0x420c > + PTRACE_SECCOMP_GET_FILTER =3D 0x420c, > #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER > + > + PTRACE_PEEKUSR_AREA =3D 0x5000, > +#define PTRACE_PEEKUSR_AREA PTRACE_PEEKUSR_AREA > + > + PTRACE_POKEUSR_AREA =3D 0x5001, > +#define PTRACE_POKEUSR_AREA PTRACE_POKEUSR_AREA > + > + PTRACE_GET_LAST_BREAK =3D 0x5006, > +#define PTRACE_GET_LAST_BREAK PTRACE_GET_LAST_BREAK > + > + PTRACE_ENABLE_TE =3D 0x5009, > +#define PTRACE_ENABLE_TE PTRACE_ENABLE_TE > + > + PTRACE_DISABLE_TE =3D 0x5010, > +#define PTRACE_DISABLE_TE PTRACE_DISABLE_TE > + > + PTRACE_TE_ABORT_RAND =3D 0x5011 > +#define PTRACE_TE_ABORT_RAND PTRACE_TE_ABORT_RAND > }; Mark Wielaard has spotted [1] a regression that I missed during review. After this change, this test case fails to compile with the following diagnostics: $ gcc -c -xc -o/dev/null - <<'EOF' #include #include EOF In file included from :1:0: /usr/include/sys/ptrace.h:93:3: error: expected identifier before numeric c= onstant PTRACE_SINGLEBLOCK =3D 12, ^ In file included from :2:0: /usr/include/sys/ptrace.h:158:0: warning: "PTRACE_PEEKUSR_AREA" redefined #define PTRACE_PEEKUSR_AREA PTRACE_PEEKUSR_AREA ^ In file included from :1:0: /usr/include/asm/ptrace.h:392:0: note: this is the location of the previous= definition #define PTRACE_PEEKUSR_AREA 0x5000 ^ In file included from :2:0: /usr/include/sys/ptrace.h:161:0: warning: "PTRACE_POKEUSR_AREA" redefined #define PTRACE_POKEUSR_AREA PTRACE_POKEUSR_AREA ^ In file included from :1:0: /usr/include/asm/ptrace.h:393:0: note: this is the location of the previous= definition #define PTRACE_POKEUSR_AREA 0x5001 ^ In file included from :2:0: /usr/include/sys/ptrace.h:164:0: warning: "PTRACE_GET_LAST_BREAK" redefined #define PTRACE_GET_LAST_BREAK PTRACE_GET_LAST_BREAK ^ In file included from :1:0: /usr/include/asm/ptrace.h:398:0: note: this is the location of the previous= definition #define PTRACE_GET_LAST_BREAK 0x5006 ^ In file included from :2:0: /usr/include/sys/ptrace.h:167:0: warning: "PTRACE_ENABLE_TE" redefined #define PTRACE_ENABLE_TE PTRACE_ENABLE_TE ^ In file included from :1:0: /usr/include/asm/ptrace.h:401:0: note: this is the location of the previous= definition #define PTRACE_ENABLE_TE 0x5009 ^ In file included from :2:0: /usr/include/sys/ptrace.h:170:0: warning: "PTRACE_DISABLE_TE" redefined #define PTRACE_DISABLE_TE PTRACE_DISABLE_TE ^ In file included from :1:0: /usr/include/asm/ptrace.h:402:0: note: this is the location of the previous= definition #define PTRACE_DISABLE_TE 0x5010 ^ In file included from :2:0: /usr/include/sys/ptrace.h:173:0: warning: "PTRACE_TE_ABORT_RAND" redefined #define PTRACE_TE_ABORT_RAND PTRACE_TE_ABORT_RAND ^ In file included from :1:0: /usr/include/asm/ptrace.h:403:0: note: this is the location of the previous= definition #define PTRACE_TE_ABORT_RAND 0x5011 ^ The following change fixes this and similar compilation issues that arise when sys/ptrace.h is included after linux/ptrace.h: --- a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h @@ -24,24 +24,61 @@ #include =20 __BEGIN_DECLS -#ifdef _LINUX_PTRACE_H +#if defined _LINUX_PTRACE_H || defined _S390_PTRACE_H /* Kludge to stop stuff gdb & strace compiles from getting upset */ #undef PTRACE_TRACEME #undef PTRACE_PEEKTEXT #undef PTRACE_PEEKDATA -#undef PTRACE_PEEKUSR #undef PTRACE_POKETEXT #undef PTRACE_POKEDATA -#undef PTRACE_POKEUSR #undef PTRACE_CONT #undef PTRACE_KILL #undef PTRACE_SINGLESTEP - +#undef PTRACE_SINGLEBLOCK #undef PTRACE_ATTACH #undef PTRACE_DETACH - #undef PTRACE_SYSCALL +#undef PTRACE_SETOPTIONS +#undef PTRACE_GETEVENTMSG +#undef PTRACE_GETSIGINFO +#undef PTRACE_SETSIGINFO +#undef PTRACE_GETREGSET +#undef PTRACE_SETREGSET +#undef PTRACE_SEIZE +#undef PTRACE_INTERRUPT +#undef PTRACE_LISTEN +#undef PTRACE_PEEKSIGINFO +#undef PTRACE_GETSIGMASK +#undef PTRACE_SETSIGMASK +#undef PTRACE_SECCOMP_GET_FILTER +#undef PTRACE_PEEKUSR_AREA +#undef PTRACE_POKEUSR_AREA +#undef PTRACE_GET_LAST_BREAK +#undef PTRACE_ENABLE_TE +#undef PTRACE_DISABLE_TE +#undef PTRACE_TE_ABORT_RAND +#undef PTRACE_O_TRACESYSGOOD +#undef PTRACE_O_TRACEFORK +#undef PTRACE_O_TRACEVFORK +#undef PTRACE_O_TRACECLONE +#undef PTRACE_O_TRACEEXEC +#undef PTRACE_O_TRACEVFORKDONE +#undef PTRACE_O_TRACEEXIT +#undef PTRACE_O_TRACESECCOMP +#undef PTRACE_O_EXITKILL +#undef PTRACE_O_SUSPEND_SECCOMP +#undef PTRACE_O_MASK +#undef PTRACE_EVENT_FORK +#undef PTRACE_EVENT_VFORK +#undef PTRACE_EVENT_CLONE +#undef PTRACE_EVENT_EXEC +#undef PTRACE_EVENT_VFORK_DONE +#undef PTRACE_EVENT_EXIT +#undef PTRACE_EVENT_SECCOMP +#undef PTRACE_EVENT_STOP +#undef PTRACE_PEEKSIGINFO_SHARED + #endif /* Type of the REQUEST argument to `ptrace.' */ enum __ptrace_request The list was produced by the following command: $ sed -n '/USER\|DEVEL/d;s/^[[:space:]]*\(PTRACE_[^=3D[:space:]]\+\)[[:spac= e:]]*=3D.*/#undef \1/p' sysdeps/unix/sysv/linux/s390/sys/ptrace.h PTRACE_PEEKUSER and PTRACE_POKEUSER were excluded because they are not defined by Linux headers, and PTRACE_SEIZE_DEVEL was excluded because it's obsolete and should be removed from sys/ptrace.h anyway. [1] https://sourceware.org/ml/elfutils-devel/2017-q3/msg00018.html --=20 ldv --h31gzZEtNLTqOjlF Content-Type: application/pgp-signature; name="signature.asc" Content-length: 801 -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJZbeD3AAoJEAVFT+BVnCUIT/AP/033pVJwik3ZS/KZc0YKaaqC wUkbbbAKtJ73jUtQb6qc1etr+QOIC6UYbKMXfH+3pPrKzPA3GSLm3UcUJjkg4E2O drN06om6WpXnVLKf+827yShTh51FF1wFPI3yUK76VrjlOWxrtwT7lmzKcf/FtqiB Apodn0givB6hGBO1ANJt2nzhws1bCp+1C2UhoRltedu+2qZUDhs9ESLFAybZlpDh QxBCQVpADhdDMMG45yAr62gbtFVa3c2par9gFd1Rkyp7buQQX1J0EElcv8ENEEKy v+agoZXNUIy8BbLDOdRWk6wh2NJwwOBDJj5Vzm5NSHOxgDNTqzYC38nlrPSTHkyZ lNR7EA+Ercc0mgxRvDZC+T8Bp1z8A9aLLnaqfZg6p5BFnNNtFFDaczqX7IBQcQ+7 xT6TTh5NbLJ0z/PR+eA0630sNlxpckT1UIIo6HpB4Km5b5mJmzFdhgVdyg94FDFB M/0fT3RN8pcvG0sQOlGVLW2O3n5KERNaqok8Od+KuRik9t7Uc2HkRWOcgTWeCJvD PnM1o3pvuKbN/viobbT7jqHVK/xk5DDoGOO99iGOeeeJYV4YMWtNJDdl6negQFMF s8kUu3smtU4dgs7dbuARha1Z7dR/JAtvsUiAIlkKqtP7PF85IvjduVlXIRS+JS69 O5Wmp7JjBgsUHLVrgZXW =kaVV -----END PGP SIGNATURE----- --h31gzZEtNLTqOjlF--