Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h

Pedro Alves
2012-04-26T18:53:15Z

On 04/26/2012 07:48 PM, Pedro Alves wrote:

> On 04/26/2012 07:33 PM, Will Deacon wrote:

>> and then we hope they all play nicely together with their own namespaces.
>>
>
>
> Bah, they don't... Before sys/ptrace.h.
>
> gcc -c -g3 -O0 -I. -I../../../src/gdb/gdbserver -I../../../src/gdb/gdbserver/../common -I../../../src/gdb/gdbserver/../regformats -I../../../src/gdb/gdbserver/../../include -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Werror ../../../src/gdb/gdbserver/linux-low.c
> In file included from /usr/include/asm/ptrace.h:58,
> from ../../../src/gdb/gdbserver/linux-low.c:27:
> /usr/include/asm/fpu.h:57: error: redefinition of Â‘struct ia64_fpregÂ’
> In file included from ../../../src/gdb/gdbserver/linux-low.c:28:
> /usr/include/sys/ptrace.h:75: error: expected identifier before numeric constant
> /usr/include/sys/ptrace.h:117: error: redefinition of Â‘struct pt_all_user_regsÂ’
> ../../../src/gdb/gdbserver/linux-low.c: In function Â‘linux_attach_lwp_1Â’:
> ../../../src/gdb/gdbserver/linux-low.c:669: error: Â‘PTRACE_ATTACHÂ’ undeclared (first use in this function)
> ../../../src/gdb/gdbserver/linux-low.c:669: error: (Each undeclared identifier is reported only once
> ../../../src/gdb/gdbserver/linux-low.c:669: error: for each function it appears in.)
> ../../../src/gdb/gdbserver/linux-low.c: In function Â‘linux_detach_one_lwpÂ’:
> ../../../src/gdb/gdbserver/linux-low.c:1139: error: Â‘PTRACE_DETACHÂ’ undeclared (first use in this function)
> make: *** [linux-low.o] Error 1
>
> After sys/ptrace.h.
>
> gcc -c -g3 -O0 -I. -I../../../src/gdb/gdbserver -I../../../src/gdb/gdbserver/../common -I../../../src/gdb/gdbserver/../regformats -I../../../src/gdb/gdbserver/../../include -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Werror ../../../src/gdb/gdbserver/linux-low.c
> In file included from /usr/include/asm/ptrace.h:58,
> from ../../../src/gdb/gdbserver/linux-low.c:28:
> /usr/include/asm/fpu.h:57: error: redefinition of Â‘struct ia64_fpregÂ’
> In file included from ../../../src/gdb/gdbserver/linux-low.c:28:
> /usr/include/asm/ptrace.h:208: error: redefinition of Â‘struct pt_all_user_regsÂ’
> make: *** [linux-low.o] Error 1
>

BTW, for the archives:

$ uname -a
Linux tic 2.6.32-5-mckinley #1 SMP Mon Oct 3 06:04:14 UTC 2011 ia64 GNU/Linux

$ cat /etc/debian_version
6.0.3

--
Pedro Alves