[PATCH 3/3] linux/x86: sync sys/ptrace.h with Linux 4.14 [BZ #22433]

Adhemerval Zanella adhemerval.zanella@linaro.org
Fri Dec 29 13:41:00 GMT 2017



On 29/12/2017 11:36, Dmitry V. Levin wrote:
> On Fri, Dec 29, 2017 at 11:13:03AM -0200, Adhemerval Zanella wrote:
>> On 27/12/2017 01:46, Dmitry V. Levin wrote:
>>> Clone generic linux/sys/ptrace.h, add the following x86-specific
>>> __ptrace_request constants: PTRACE_GET_THREAD_AREA,
>>> PTRACE_SET_THREAD_AREA, PTRACE_ARCH_PRCTL, PTRACE_SYSEMU,
>>> PTRACE_SYSEMU_SINGLESTEP, and PTRACE_SINGLEBLOCK.
>>>
>>> [BZ #22433]
>>> * sysdeps/unix/sysv/linux/x86/sys/ptrace.h: New file.
>>
>> Wouldn't be better to avoid code duplication to add a ptrace-arch.h as an
>> empty one for generic case and add a x86 with the arch-specific bits?
> 
> Maybe, but there are two complications.
> 
> First, this x86/bits/ptrace-arch.h would have to contain a part of
> enum __ptrace_request definition - are we OK with distributing
> such ugly looking arch-specific bits?
> 
> Second, there are exceptions, e.g. ia64/sys/ptrace.h includes additional
> headers and defines struct __pt_all_user_regs, s390/sys/ptrace.h and
> sparc/sys/ptrace.h undefine potentially conflicting PTRACE_* macros -
> we would have to #include more arch-specific bits to accommodate them.
> 
> 

Indeed breaking down the enum on arch-specific bits does not seems a good
refactor way.  It seems ptrace.h justify to be a quite arch-specific
header.

The patch LGTM then.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20171229/eebad1e9/attachment.sig>


More information about the Libc-alpha mailing list