* [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
@ 2012-04-26 18:06 Will Deacon
2012-04-26 18:11 ` Pedro Alves
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Will Deacon @ 2012-04-26 18:06 UTC (permalink / raw)
To: gdb-patches; +Cc: palves, Will Deacon
When debugging a uclinux target, it is necessary to retrieve the text
and data offsets of the running program in order for symbol resolution
to work correctly.
This patch pulls in definitions for PT_{TEXT,DATA,TEXT_END}_ADDR from
the kernel's exported ptrace header, which can be issued as `magic'
addresses to the PTRACE_PEEKUSER request in order to retrieve the child
offsets. For those architectures currently providing their own inline
definitions, the existing code is used as a fallback if the header
doesn't provide any overrides.
---
2012-04-26 Will Deacon <will.deacon@arm.com>
* linux-low.c: Pull in PT_TEXT_ADDR, PT_TEXT_END_ADDR and
PT_DATA_ADDR definitions from asm/ptrace.h.
gdb/gdbserver/linux-low.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index bbb0693..0d1cbd0 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -78,6 +78,8 @@
#ifdef __UCLIBC__
#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
+/* PTRACE_TEXT_ADDR and friends. */
+#include <asm/ptrace.h>
#define HAS_NOMMU
#endif
#endif
@@ -4759,6 +4761,9 @@ linux_stopped_data_address (void)
}
#if defined(__UCLIBC__) && defined(HAS_NOMMU)
+#if !(defined(PT_TEXT_ADDR) || \
+ defined(PT_DATA_ADDR) || \
+ defined(PT_TEXT_END_ADDR))
#if defined(__mcoldfire__)
/* These should really be defined in the kernel's ptrace.h header. */
#define PT_TEXT_ADDR 49*4
@@ -4773,6 +4778,7 @@ linux_stopped_data_address (void)
#define PT_DATA_ADDR (0x10004*4)
#define PT_TEXT_END_ADDR (0x10008*4)
#endif
+#endif
/* Under uClinux, programs are loaded at non-zero offsets, which we need
to tell gdb about. */
--
1.7.4.1
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 18:06 [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h Will Deacon
@ 2012-04-26 18:11 ` Pedro Alves
2012-04-26 18:15 ` Mike Frysinger
2012-04-26 19:36 ` Pedro Alves
2 siblings, 0 replies; 15+ messages in thread
From: Pedro Alves @ 2012-04-26 18:11 UTC (permalink / raw)
To: Will Deacon; +Cc: gdb-patches
On 04/26/2012 07:03 PM, Will Deacon wrote:
> #ifdef __UCLIBC__
> #if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
> +/* PTRACE_TEXT_ADDR and friends. */
> +#include <asm/ptrace.h>
> #define HAS_NOMMU
> #endif
> #endif
Is there a reason you're still not putting this unconditionally at
the top, next to sys/ptrace.h, etc.?
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 18:06 [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h Will Deacon
2012-04-26 18:11 ` Pedro Alves
@ 2012-04-26 18:15 ` Mike Frysinger
2012-04-26 18:23 ` Pedro Alves
2012-04-26 18:37 ` Will Deacon
2012-04-26 19:36 ` Pedro Alves
2 siblings, 2 replies; 15+ messages in thread
From: Mike Frysinger @ 2012-04-26 18:15 UTC (permalink / raw)
To: gdb-patches; +Cc: Will Deacon, palves
[-- Attachment #1: Type: Text/Plain, Size: 678 bytes --]
On Thursday 26 April 2012 14:03:00 Will Deacon wrote:
> +/* PTRACE_TEXT_ADDR and friends. */
> +#include <asm/ptrace.h>
check for asm/ptrace.h in configure.ac and then just depend on
HAVE_ASM_PTRACE_H ? although this is fine too since uClibc is realistically
the only C library being used with no-mmu Linux systems.
> #if defined(__UCLIBC__) && defined(HAS_NOMMU)
> +#if !(defined(PT_TEXT_ADDR) || \
> + defined(PT_DATA_ADDR) || \
> + defined(PT_TEXT_END_ADDR))
i think the GNU way is to have the || at the start of line rather than end,
and a space before the "(" (although i can see that rule isn't completely
honored in this file).
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 18:15 ` Mike Frysinger
@ 2012-04-26 18:23 ` Pedro Alves
2012-04-26 18:26 ` Mike Frysinger
2012-04-26 18:37 ` Will Deacon
1 sibling, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2012-04-26 18:23 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches, Will Deacon
On 04/26/2012 07:12 PM, Mike Frysinger wrote:
> On Thursday 26 April 2012 14:03:00 Will Deacon wrote:
>> > +/* PTRACE_TEXT_ADDR and friends. */
>> > +#include <asm/ptrace.h>
> check for asm/ptrace.h in configure.ac and then just depend on
> HAVE_ASM_PTRACE_H ? although this is fine too since uClibc is realistically
> the only C library being used with no-mmu Linux systems.
Was there a time Linux didn't have this header? When we include it GDB, we
include it unconditionally (though we don't include it in all ports), and in
current mainline, it seems that all 27 ports under arch/ have it.
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 18:23 ` Pedro Alves
@ 2012-04-26 18:26 ` Mike Frysinger
2012-04-26 18:34 ` Pedro Alves
0 siblings, 1 reply; 15+ messages in thread
From: Mike Frysinger @ 2012-04-26 18:26 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, Will Deacon
[-- Attachment #1: Type: Text/Plain, Size: 1019 bytes --]
On Thursday 26 April 2012 14:14:59 Pedro Alves wrote:
> On 04/26/2012 07:12 PM, Mike Frysinger wrote:
> > On Thursday 26 April 2012 14:03:00 Will Deacon wrote:
> >> > +/* PTRACE_TEXT_ADDR and friends. */
> >> > +#include <asm/ptrace.h>
> >
> > check for asm/ptrace.h in configure.ac and then just depend on
> > HAVE_ASM_PTRACE_H ? although this is fine too since uClibc is
> > realistically the only C library being used with no-mmu Linux systems.
>
> Was there a time Linux didn't have this header? When we include it GDB, we
> include it unconditionally (though we don't include it in all ports), and
> in current mainline, it seems that all 27 ports under arch/ have it.
it's not so much a matter of whether it's provided, but whether it can be
safely included. ia64 has a history of being a pita to include their ptrace
headers, but maybe that doesn't matter to gdbserver.
might be worth seeing if we can do a release with an unconditional include and
see if anyone complains.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 18:26 ` Mike Frysinger
@ 2012-04-26 18:34 ` Pedro Alves
2012-04-26 18:36 ` Will Deacon
0 siblings, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2012-04-26 18:34 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches, Will Deacon
On 04/26/2012 07:27 PM, Mike Frysinger wrote:
> On Thursday 26 April 2012 14:14:59 Pedro Alves wrote:
>> On 04/26/2012 07:12 PM, Mike Frysinger wrote:
>>> On Thursday 26 April 2012 14:03:00 Will Deacon wrote:
>>>>> +/* PTRACE_TEXT_ADDR and friends. */
>>>>> +#include <asm/ptrace.h>
>>>
>>> check for asm/ptrace.h in configure.ac and then just depend on
>>> HAVE_ASM_PTRACE_H ? although this is fine too since uClibc is
>>> realistically the only C library being used with no-mmu Linux systems.
>>
>> Was there a time Linux didn't have this header? When we include it GDB, we
>> include it unconditionally (though we don't include it in all ports), and
>> in current mainline, it seems that all 27 ports under arch/ have it.
>
> it's not so much a matter of whether it's provided, but whether it can be
> safely included. ia64 has a history of being a pita to include their ptrace
> headers, but maybe that doesn't matter to gdbserver.
There are ia64 boxes on the gcc compile farm. Let me give that a try.
> might be worth seeing if we can do a release with an unconditional include and
> see if anyone complains.
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 18:34 ` Pedro Alves
@ 2012-04-26 18:36 ` Will Deacon
2012-04-26 18:53 ` Pedro Alves
0 siblings, 1 reply; 15+ messages in thread
From: Will Deacon @ 2012-04-26 18:36 UTC (permalink / raw)
To: Pedro Alves; +Cc: Mike Frysinger, gdb-patches
On Thu, Apr 26, 2012 at 07:31:05PM +0100, Pedro Alves wrote:
> On 04/26/2012 07:27 PM, Mike Frysinger wrote:
>
> > On Thursday 26 April 2012 14:14:59 Pedro Alves wrote:
> >> On 04/26/2012 07:12 PM, Mike Frysinger wrote:
> >>> On Thursday 26 April 2012 14:03:00 Will Deacon wrote:
> >>>>> +/* PTRACE_TEXT_ADDR and friends. */
> >>>>> +#include <asm/ptrace.h>
> >>>
> >>> check for asm/ptrace.h in configure.ac and then just depend on
> >>> HAVE_ASM_PTRACE_H ? although this is fine too since uClibc is
> >>> realistically the only C library being used with no-mmu Linux systems.
> >>
> >> Was there a time Linux didn't have this header? When we include it GDB, we
> >> include it unconditionally (though we don't include it in all ports), and
> >> in current mainline, it seems that all 27 ports under arch/ have it.
> >
> > it's not so much a matter of whether it's provided, but whether it can be
> > safely included. ia64 has a history of being a pita to include their ptrace
> > headers, but maybe that doesn't matter to gdbserver.
>
>
> There are ia64 boxes on the gcc compile farm. Let me give that a try.
The ordering of includes probably also comes into play here. I guess we
want:
<asm/ptrace.h>
<sys/ptrace.h>
"linux-ptrace.h"
and then we hope they all play nicely together with their own namespaces.
Will
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 18:36 ` Will Deacon
@ 2012-04-26 18:53 ` Pedro Alves
2012-04-26 18:59 ` Pedro Alves
2012-04-26 19:06 ` Mike Frysinger
0 siblings, 2 replies; 15+ messages in thread
From: Pedro Alves @ 2012-04-26 18:53 UTC (permalink / raw)
To: Will Deacon; +Cc: Mike Frysinger, gdb-patches
On 04/26/2012 07:33 PM, Will Deacon wrote:
> On Thu, Apr 26, 2012 at 07:31:05PM +0100, Pedro Alves wrote:
>> On 04/26/2012 07:27 PM, Mike Frysinger wrote:
>>
>>> On Thursday 26 April 2012 14:14:59 Pedro Alves wrote:
>>>> On 04/26/2012 07:12 PM, Mike Frysinger wrote:
>>>>> On Thursday 26 April 2012 14:03:00 Will Deacon wrote:
>>>>>>> +/* PTRACE_TEXT_ADDR and friends. */
>>>>>>> +#include <asm/ptrace.h>
>>>>>
>>>>> check for asm/ptrace.h in configure.ac and then just depend on
>>>>> HAVE_ASM_PTRACE_H ? although this is fine too since uClibc is
>>>>> realistically the only C library being used with no-mmu Linux systems.
>>>>
>>>> Was there a time Linux didn't have this header? When we include it GDB, we
>>>> include it unconditionally (though we don't include it in all ports), and
>>>> in current mainline, it seems that all 27 ports under arch/ have it.
>>>
>>> it's not so much a matter of whether it's provided, but whether it can be
>>> safely included. ia64 has a history of being a pita to include their ptrace
>>> headers, but maybe that doesn't matter to gdbserver.
>>
>>
>> There are ia64 boxes on the gcc compile farm. Let me give that a try.
>
> The ordering of includes probably also comes into play here. I guess we
> want:
>
> <asm/ptrace.h>
> <sys/ptrace.h>
> "linux-ptrace.h"
>
> 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
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 18:53 ` Pedro Alves
@ 2012-04-26 18:59 ` Pedro Alves
2012-04-26 19:06 ` Mike Frysinger
1 sibling, 0 replies; 15+ messages in thread
From: Pedro Alves @ 2012-04-26 18:59 UTC (permalink / raw)
Cc: Will Deacon, Mike Frysinger, gdb-patches
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 18:53 ` Pedro Alves
2012-04-26 18:59 ` Pedro Alves
@ 2012-04-26 19:06 ` Mike Frysinger
2012-04-26 19:26 ` Pedro Alves
1 sibling, 1 reply; 15+ messages in thread
From: Mike Frysinger @ 2012-04-26 19:06 UTC (permalink / raw)
To: Pedro Alves; +Cc: Will Deacon, gdb-patches
[-- Attachment #1: Type: Text/Plain, Size: 3880 bytes --]
On Thursday 26 April 2012 14:48:13 Pedro Alves wrote:
> On 04/26/2012 07:33 PM, Will Deacon wrote:
> > On Thu, Apr 26, 2012 at 07:31:05PM +0100, Pedro Alves wrote:
> >> On 04/26/2012 07:27 PM, Mike Frysinger wrote:
> >>> On Thursday 26 April 2012 14:14:59 Pedro Alves wrote:
> >>>> On 04/26/2012 07:12 PM, Mike Frysinger wrote:
> >>>>> On Thursday 26 April 2012 14:03:00 Will Deacon wrote:
> >>>>>>> +/* PTRACE_TEXT_ADDR and friends. */
> >>>>>>> +#include <asm/ptrace.h>
> >>>>>
> >>>>> check for asm/ptrace.h in configure.ac and then just depend on
> >>>>> HAVE_ASM_PTRACE_H ? although this is fine too since uClibc is
> >>>>> realistically the only C library being used with no-mmu Linux
> >>>>> systems.
> >>>>
> >>>> Was there a time Linux didn't have this header? When we include it
> >>>> GDB, we include it unconditionally (though we don't include it in all
> >>>> ports), and in current mainline, it seems that all 27 ports under
> >>>> arch/ have it.
> >>>
> >>> it's not so much a matter of whether it's provided, but whether it can
> >>> be safely included. ia64 has a history of being a pita to include
> >>> their ptrace headers, but maybe that doesn't matter to gdbserver.
> >>
> >> There are ia64 boxes on the gcc compile farm. Let me give that a try.
> >
> > The ordering of includes probably also comes into play here. I guess we
> > want:
> >
> > <asm/ptrace.h>
> > <sys/ptrace.h>
> > "linux-ptrace.h"
> >
> > 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
yes, now you see the pain that ia64 inflicts upon thee!
seems ia64-linux-nat.c skips asm/ptrace.h and goes just for asm/ptrace-
offsets.h
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 19:06 ` Mike Frysinger
@ 2012-04-26 19:26 ` Pedro Alves
2012-04-27 7:25 ` Jan Kratochvil
0 siblings, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2012-04-26 19:26 UTC (permalink / raw)
To: Mike Frysinger; +Cc: Will Deacon, gdb-patches
On 04/26/2012 08:05 PM, Mike Frysinger wrote:
>
> yes, now you see the pain that ia64 inflicts upon thee!
>
> seems ia64-linux-nat.c skips asm/ptrace.h and goes just for asm/ptrace-
> offsets.h
Indeed. I've now peeked at strace's sources, and they do some butt-ugly
#ifdef'ery to pick sys/ptrace.h vs asm/ptrace.h depending on arch x libc.
So fine with me to forget about including the header at the top, until we
find some other need.
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 19:26 ` Pedro Alves
@ 2012-04-27 7:25 ` Jan Kratochvil
0 siblings, 0 replies; 15+ messages in thread
From: Jan Kratochvil @ 2012-04-27 7:25 UTC (permalink / raw)
To: Pedro Alves; +Cc: Mike Frysinger, Will Deacon, gdb-patches
On Thu, 26 Apr 2012 21:20:34 +0200, Pedro Alves wrote:
> Indeed. I've now peeked at strace's sources, and they do some butt-ugly
> #ifdef'ery to pick sys/ptrace.h vs asm/ptrace.h depending on arch x libc.
> So fine with me to forget about including the header at the top, until we
> find some other need.
in
http://sourceware.org/systemtap/wiki/utrace/tests
the ptrace.h inclusion compatible back to RHEL-4 and across
x86*/ppc*/s390*/ia64 ended up as:
#ifdef __ia64__
#define ia64_fpreg ia64_fpreg_DISABLE
#define pt_all_user_regs pt_all_user_regs_DISABLE
#endif /* __ia64__ */
#include <sys/ptrace.h>
#ifdef __ia64__
#undef ia64_fpreg
#undef pt_all_user_regs
#endif /* __ia64__ */
#include <linux/ptrace.h>
#include <sys/types.h>
#include <sys/user.h>
#if defined __i386__ || defined __x86_64__
#include <sys/debugreg.h>
#endif
It may be partially unrelated as there were needed more symbols than in
gdbserver, OTOH it does not have to solve non-Linux platforms.
Regards,
Jan
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 18:15 ` Mike Frysinger
2012-04-26 18:23 ` Pedro Alves
@ 2012-04-26 18:37 ` Will Deacon
1 sibling, 0 replies; 15+ messages in thread
From: Will Deacon @ 2012-04-26 18:37 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches, palves
Hi Mike,
On Thu, Apr 26, 2012 at 07:12:31PM +0100, Mike Frysinger wrote:
> On Thursday 26 April 2012 14:03:00 Will Deacon wrote:
> > +/* PTRACE_TEXT_ADDR and friends. */
> > +#include <asm/ptrace.h>
>
> check for asm/ptrace.h in configure.ac and then just depend on
> HAVE_ASM_PTRACE_H ? although this is fine too since uClibc is realistically
> the only C library being used with no-mmu Linux systems.
I'll see how Pedro gets on with the unconditional include first.
> > #if defined(__UCLIBC__) && defined(HAS_NOMMU)
> > +#if !(defined(PT_TEXT_ADDR) || \
> > + defined(PT_DATA_ADDR) || \
> > + defined(PT_TEXT_END_ADDR))
>
> i think the GNU way is to have the || at the start of line rather than end,
> and a space before the "(" (although i can see that rule isn't completely
> honored in this file).
Thanks, will fix.
Will
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 18:06 [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h Will Deacon
2012-04-26 18:11 ` Pedro Alves
2012-04-26 18:15 ` Mike Frysinger
@ 2012-04-26 19:36 ` Pedro Alves
2012-04-27 10:32 ` Will Deacon
2 siblings, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2012-04-26 19:36 UTC (permalink / raw)
To: Will Deacon; +Cc: gdb-patches
On 04/26/2012 07:03 PM, Will Deacon wrote:
> 2012-04-26 Will Deacon <will.deacon@arm.com>
>
> * linux-low.c: Pull in PT_TEXT_ADDR, PT_TEXT_END_ADDR and
> PT_DATA_ADDR definitions from asm/ptrace.h.
This needs tweaking to conform to the GNU Coding Standards. Write as:
* linux-low.c [__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)]:
Include asm/ptrace.h.
(PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
already defined.
Okay with this, and the formatting issues pointed out by Mike fixed.
Though I do think that we don't need to worry about only a subset being defined...
Thanks guys.
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h
2012-04-26 19:36 ` Pedro Alves
@ 2012-04-27 10:32 ` Will Deacon
0 siblings, 0 replies; 15+ messages in thread
From: Will Deacon @ 2012-04-27 10:32 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
On Thu, Apr 26, 2012 at 08:33:10PM +0100, Pedro Alves wrote:
> On 04/26/2012 07:03 PM, Will Deacon wrote:
>
> > 2012-04-26 Will Deacon <will.deacon@arm.com>
> >
> > * linux-low.c: Pull in PT_TEXT_ADDR, PT_TEXT_END_ADDR and
> > PT_DATA_ADDR definitions from asm/ptrace.h.
>
>
> This needs tweaking to conform to the GNU Coding Standards. Write as:
>
> * linux-low.c [__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)]:
> Include asm/ptrace.h.
> (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
> already defined.
>
> Okay with this, and the formatting issues pointed out by Mike fixed.
Thanks Pedro, I'll post a v4 with the formatting changes today.
Will
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2012-04-27 10:14 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-26 18:06 [PATCH v3] gdbserver: uclinux: pull in ptrace offset definitions from asm/ptrace.h Will Deacon
2012-04-26 18:11 ` Pedro Alves
2012-04-26 18:15 ` Mike Frysinger
2012-04-26 18:23 ` Pedro Alves
2012-04-26 18:26 ` Mike Frysinger
2012-04-26 18:34 ` Pedro Alves
2012-04-26 18:36 ` Will Deacon
2012-04-26 18:53 ` Pedro Alves
2012-04-26 18:59 ` Pedro Alves
2012-04-26 19:06 ` Mike Frysinger
2012-04-26 19:26 ` Pedro Alves
2012-04-27 7:25 ` Jan Kratochvil
2012-04-26 18:37 ` Will Deacon
2012-04-26 19:36 ` Pedro Alves
2012-04-27 10:32 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox