Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [ob] user-regs.c build fix for arm-linux
@ 2004-02-28 17:31 Daniel Jacobowitz
  2004-02-28 17:36 ` Andrew Cagney
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-02-28 17:31 UTC (permalink / raw)
  To: gdb-patches

You can't build a native arm-linux GDB right now.  A system header pulled in
by defs.h defines "struct user_regs", which conflicts with user-regs.c.

I think this patch is obvious.  I'll commit it in a day or two if no one
objects.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-02-28  Daniel Jacobowitz  <drow@mvista.com>

	* user-regs.c: Update copyright years.
	(struct user_regs): Rename to gdb_user_regs.
	(append_user_reg, builtin_user_regs, user_regs_init)
	(user_reg_add, user_reg_map_name_to_regnum)
	(usernum_to_user_reg): Update.

Index: gdb/user-regs.c
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/user-regs.c,v
retrieving revision 1.3
diff -u -p -r1.3 user-regs.c
--- gdb/user-regs.c	4 Aug 2003 22:24:44 -0000	1.3
+++ gdb/user-regs.c	28 Feb 2004 17:28:34 -0000
@@ -1,6 +1,6 @@
 /* User visible, per-frame registers, for GDB, the GNU debugger.
 
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Red Hat.
 
@@ -45,14 +45,17 @@ struct user_reg
   struct user_reg *next;
 };
 
-struct user_regs
+/* We call this gdb_user_regs instead of user_regs to avoid conflicts with
+   any struct user_regs in system headers (for instance, ARM GNU/Linux).  */
+
+struct gdb_user_regs
 {
   struct user_reg *first;
   struct user_reg **last;
 };
 
 static void
-append_user_reg (struct user_regs *regs, const char *name,
+append_user_reg (struct gdb_user_regs *regs, const char *name,
 		 user_reg_read_ftype *read, struct user_reg *reg)
 {
   /* The caller is responsible for allocating memory needed to store
@@ -68,7 +71,7 @@ append_user_reg (struct user_regs *regs,
 
 /* An array of the builtin user registers.  */
 
-static struct user_regs builtin_user_regs = { NULL, &builtin_user_regs.first };
+static struct gdb_user_regs builtin_user_regs = { NULL, &builtin_user_regs.first };
 
 void
 user_reg_add_builtin (const char *name, user_reg_read_ftype *read)
@@ -86,7 +89,7 @@ static void *
 user_regs_init (struct gdbarch *gdbarch)
 {
   struct user_reg *reg;
-  struct user_regs *regs = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct user_regs);
+  struct gdb_user_regs *regs = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct gdb_user_regs);
   regs->last = &regs->first;
   for (reg = builtin_user_regs.first; reg != NULL; reg = reg->next)
     append_user_reg (regs, reg->name, reg->read,
@@ -98,7 +101,7 @@ void
 user_reg_add (struct gdbarch *gdbarch, const char *name,
 		 user_reg_read_ftype *read)
 {
-  struct user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
+  struct gdb_user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
   if (regs == NULL)
     {
       /* ULGH, called during architecture initialization.  Patch
@@ -137,7 +140,7 @@ user_reg_map_name_to_regnum (struct gdba
 
   /* Search the user name space.  */
   {
-    struct user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
+    struct gdb_user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
     struct user_reg *reg;
     int nr;
     for (nr = 0, reg = regs->first; reg != NULL; reg = reg->next, nr++)
@@ -155,7 +158,7 @@ user_reg_map_name_to_regnum (struct gdba
 static struct user_reg *
 usernum_to_user_reg (struct gdbarch *gdbarch, int usernum)
 {
-  struct user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
+  struct gdb_user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
   struct user_reg *reg;
   for (reg = regs->first; reg != NULL; reg = reg->next)
     {


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ob] user-regs.c build fix for arm-linux
  2004-02-28 17:31 [ob] user-regs.c build fix for arm-linux Daniel Jacobowitz
@ 2004-02-28 17:36 ` Andrew Cagney
  2004-02-28 18:30   ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cagney @ 2004-02-28 17:36 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> +/* We call this gdb_user_regs instead of user_regs to avoid conflicts with
> +   any struct user_regs in system headers (for instance, ARM GNU/Linux).  */

Please be more explicit.

Andrew



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ob] user-regs.c build fix for arm-linux
  2004-02-28 17:36 ` Andrew Cagney
@ 2004-02-28 18:30   ` Daniel Jacobowitz
  2004-02-28 18:49     ` Andrew Cagney
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-02-28 18:30 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

On Sat, Feb 28, 2004 at 12:35:52PM -0500, Andrew Cagney wrote:
> >+/* We call this gdb_user_regs instead of user_regs to avoid conflicts with
> >+   any struct user_regs in system headers (for instance, ARM GNU/Linux).  
> >*/
> 
> Please be more explicit.

What else would you like to know?  What header it comes from?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ob] user-regs.c build fix for arm-linux
  2004-02-28 18:30   ` Daniel Jacobowitz
@ 2004-02-28 18:49     ` Andrew Cagney
  2004-02-29  0:53       ` Daniel Jacobowitz
  2004-02-29 16:59       ` Daniel Jacobowitz
  0 siblings, 2 replies; 10+ messages in thread
From: Andrew Cagney @ 2004-02-28 18:49 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> On Sat, Feb 28, 2004 at 12:35:52PM -0500, Andrew Cagney wrote:
> 
>>>> >+/* We call this gdb_user_regs instead of user_regs to avoid conflicts with
>>>> >+   any struct user_regs in system headers (for instance, ARM GNU/Linux).  
>>>> >*/
>>
>>> 
>>> Please be more explicit.
> 
> 
> What else would you like to know?  What header it comes from?

Er, yes?  The comment should describe the exact cause of the problem. 
Otherwize there is no way to audit this stuff later.

BTW, wouldn't this stuff, and not ICU have been a better thing to do 
last weekend?

Andrew



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ob] user-regs.c build fix for arm-linux
  2004-02-28 18:49     ` Andrew Cagney
@ 2004-02-29  0:53       ` Daniel Jacobowitz
  2004-02-29 16:59       ` Daniel Jacobowitz
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-02-29  0:53 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

On Sat, Feb 28, 2004 at 01:49:48PM -0500, Andrew Cagney wrote:
> >On Sat, Feb 28, 2004 at 12:35:52PM -0500, Andrew Cagney wrote:
> >
> >>>>>+/* We call this gdb_user_regs instead of user_regs to avoid conflicts 
> >>>>with
> >>>>>+   any struct user_regs in system headers (for instance, ARM 
> >>>>GNU/Linux).  >*/
> >>
> >>>
> >>>Please be more explicit.
> >
> >
> >What else would you like to know?  What header it comes from?
> 
> Er, yes?  The comment should describe the exact cause of the problem. 
> Otherwize there is no way to audit this stuff later.
> 
> BTW, wouldn't this stuff, and not ICU have been a better thing to do 
> last weekend?

Andrew, please do not attempt to dictate to me the use of my time as a
volunteer.  I have already explained to you that ICU is important to me
and to the distributions I contribute to, and I resent your continual
objections.  I'm perfectly willing for my submitted patches to sit and
wait until after the branch.

The next important thing on my list after that was merging our internal
tree to the GDB HEAD for testing purposes, and that's what I'm doing
now.  I'll do MIPS next week.  Normally I wouldn't do any of this until
after the branch was cut anyway.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ob] user-regs.c build fix for arm-linux
  2004-02-28 18:49     ` Andrew Cagney
  2004-02-29  0:53       ` Daniel Jacobowitz
@ 2004-02-29 16:59       ` Daniel Jacobowitz
  2004-03-05  5:23         ` Andrew Cagney
  2004-03-19  0:09         ` Daniel Jacobowitz
  1 sibling, 2 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-02-29 16:59 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

On Sat, Feb 28, 2004 at 01:49:48PM -0500, Andrew Cagney wrote:
> >On Sat, Feb 28, 2004 at 12:35:52PM -0500, Andrew Cagney wrote:
> >
> >>>>>+/* We call this gdb_user_regs instead of user_regs to avoid conflicts 
> >>>>with
> >>>>>+   any struct user_regs in system headers (for instance, ARM 
> >>>>GNU/Linux).  >*/
> >>
> >>>
> >>>Please be more explicit.
> >
> >
> >What else would you like to know?  What header it comes from?
> 
> Er, yes?  The comment should describe the exact cause of the problem. 
> Otherwize there is no way to audit this stuff later.

Is this better?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-02-29  Daniel Jacobowitz  <drow@mvista.com>

	* user-regs.c: Update copyright years.
	(struct user_regs): Rename to gdb_user_regs.
	(append_user_reg, builtin_user_regs, user_regs_init)
	(user_reg_add, user_reg_map_name_to_regnum)
	(usernum_to_user_reg): Update.

Index: gdb/user-regs.c
===================================================================
RCS file: /cvs/src/src/gdb/user-regs.c,v
retrieving revision 1.3
diff -u -p -r1.3 user-regs.c
--- gdb/user-regs.c	4 Aug 2003 22:24:44 -0000	1.3
+++ gdb/user-regs.c	29 Feb 2004 16:58:25 -0000
@@ -1,6 +1,6 @@
 /* User visible, per-frame registers, for GDB, the GNU debugger.
 
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Red Hat.
 
@@ -45,14 +45,20 @@ struct user_reg
   struct user_reg *next;
 };
 
-struct user_regs
+/* This structure is named gdb_user_regs instead of user_regs to avoid
+   conflicts with any "struct user_regs" in system headers.  For instance,
+   on ARM GNU/Linux native builds, nm-linux.h includes <signal.h> includes
+   <sys/ucontext.h> includes <sys/procfs.h> includes <sys/user.h>, which
+   declares "struc user_regs".  */
+
+struct gdb_user_regs
 {
   struct user_reg *first;
   struct user_reg **last;
 };
 
 static void
-append_user_reg (struct user_regs *regs, const char *name,
+append_user_reg (struct gdb_user_regs *regs, const char *name,
 		 user_reg_read_ftype *read, struct user_reg *reg)
 {
   /* The caller is responsible for allocating memory needed to store
@@ -68,7 +74,7 @@ append_user_reg (struct user_regs *regs,
 
 /* An array of the builtin user registers.  */
 
-static struct user_regs builtin_user_regs = { NULL, &builtin_user_regs.first };
+static struct gdb_user_regs builtin_user_regs = { NULL, &builtin_user_regs.first };
 
 void
 user_reg_add_builtin (const char *name, user_reg_read_ftype *read)
@@ -86,7 +92,7 @@ static void *
 user_regs_init (struct gdbarch *gdbarch)
 {
   struct user_reg *reg;
-  struct user_regs *regs = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct user_regs);
+  struct gdb_user_regs *regs = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct gdb_user_regs);
   regs->last = &regs->first;
   for (reg = builtin_user_regs.first; reg != NULL; reg = reg->next)
     append_user_reg (regs, reg->name, reg->read,
@@ -98,7 +104,7 @@ void
 user_reg_add (struct gdbarch *gdbarch, const char *name,
 		 user_reg_read_ftype *read)
 {
-  struct user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
+  struct gdb_user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
   if (regs == NULL)
     {
       /* ULGH, called during architecture initialization.  Patch
@@ -137,7 +143,7 @@ user_reg_map_name_to_regnum (struct gdba
 
   /* Search the user name space.  */
   {
-    struct user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
+    struct gdb_user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
     struct user_reg *reg;
     int nr;
     for (nr = 0, reg = regs->first; reg != NULL; reg = reg->next, nr++)
@@ -155,7 +161,7 @@ user_reg_map_name_to_regnum (struct gdba
 static struct user_reg *
 usernum_to_user_reg (struct gdbarch *gdbarch, int usernum)
 {
-  struct user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
+  struct gdb_user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
   struct user_reg *reg;
   for (reg = regs->first; reg != NULL; reg = reg->next)
     {


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ob] user-regs.c build fix for arm-linux
  2004-02-29 16:59       ` Daniel Jacobowitz
@ 2004-03-05  5:23         ` Andrew Cagney
  2004-03-19  0:09           ` Andrew Cagney
  2004-03-19  0:09         ` Daniel Jacobowitz
  1 sibling, 1 reply; 10+ messages in thread
From: Andrew Cagney @ 2004-03-05  5:23 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> +/* This structure is named gdb_user_regs instead of user_regs to avoid
> +   conflicts with any "struct user_regs" in system headers.  For instance,
> +   on ARM GNU/Linux native builds, nm-linux.h includes <signal.h> includes
> +   <sys/ucontext.h> includes <sys/procfs.h> includes <sys/user.h>, which
> +   declares "struc user_regs".  */

Even shorter, for instance:

/* This structure is named gdb_user_regs, instead of user_regs, to avoid 
  a comflict with <sys/user.h> defined "struct user_regs" on ARM 
GNU/Linux  (included by: nm-linux.h -> <signal.h> -> <sys/ucontext.h> -> 
<sys/procfs.h>).  */

which is just stating the facts.

Andrew



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ob] user-regs.c build fix for arm-linux
  2004-03-19  0:09         ` Daniel Jacobowitz
@ 2004-03-09 20:05           ` Daniel Jacobowitz
  0 siblings, 0 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-03-09 20:05 UTC (permalink / raw)
  To: gdb-patches

On Sun, Feb 29, 2004 at 11:59:29AM -0500, Daniel Jacobowitz wrote:
> On Sat, Feb 28, 2004 at 01:49:48PM -0500, Andrew Cagney wrote:
> > >On Sat, Feb 28, 2004 at 12:35:52PM -0500, Andrew Cagney wrote:
> > >
> > >>>>>+/* We call this gdb_user_regs instead of user_regs to avoid conflicts 
> > >>>>with
> > >>>>>+   any struct user_regs in system headers (for instance, ARM 
> > >>>>GNU/Linux).  >*/
> > >>
> > >>>
> > >>>Please be more explicit.
> > >
> > >
> > >What else would you like to know?  What header it comes from?
> > 
> > Er, yes?  The comment should describe the exact cause of the problem. 
> > Otherwize there is no way to audit this stuff later.
> 
> Is this better?

> 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
> 
> 	* user-regs.c: Update copyright years.
> 	(struct user_regs): Rename to gdb_user_regs.
> 	(append_user_reg, builtin_user_regs, user_regs_init)
> 	(user_reg_add, user_reg_map_name_to_regnum)
> 	(usernum_to_user_reg): Update.

I've checked this in...

> +   declares "struc user_regs".  */

And fixed the typo in it.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ob] user-regs.c build fix for arm-linux
  2004-02-29 16:59       ` Daniel Jacobowitz
  2004-03-05  5:23         ` Andrew Cagney
@ 2004-03-19  0:09         ` Daniel Jacobowitz
  2004-03-09 20:05           ` Daniel Jacobowitz
  1 sibling, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-03-19  0:09 UTC (permalink / raw)
  To: gdb-patches

On Sun, Feb 29, 2004 at 11:59:29AM -0500, Daniel Jacobowitz wrote:
> On Sat, Feb 28, 2004 at 01:49:48PM -0500, Andrew Cagney wrote:
> > >On Sat, Feb 28, 2004 at 12:35:52PM -0500, Andrew Cagney wrote:
> > >
> > >>>>>+/* We call this gdb_user_regs instead of user_regs to avoid conflicts 
> > >>>>with
> > >>>>>+   any struct user_regs in system headers (for instance, ARM 
> > >>>>GNU/Linux).  >*/
> > >>
> > >>>
> > >>>Please be more explicit.
> > >
> > >
> > >What else would you like to know?  What header it comes from?
> > 
> > Er, yes?  The comment should describe the exact cause of the problem. 
> > Otherwize there is no way to audit this stuff later.
> 
> Is this better?

> 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
> 
> 	* user-regs.c: Update copyright years.
> 	(struct user_regs): Rename to gdb_user_regs.
> 	(append_user_reg, builtin_user_regs, user_regs_init)
> 	(user_reg_add, user_reg_map_name_to_regnum)
> 	(usernum_to_user_reg): Update.

I've checked this in...

> +   declares "struc user_regs".  */

And fixed the typo in it.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ob] user-regs.c build fix for arm-linux
  2004-03-05  5:23         ` Andrew Cagney
@ 2004-03-19  0:09           ` Andrew Cagney
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Cagney @ 2004-03-19  0:09 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> +/* This structure is named gdb_user_regs instead of user_regs to avoid
> +   conflicts with any "struct user_regs" in system headers.  For instance,
> +   on ARM GNU/Linux native builds, nm-linux.h includes <signal.h> includes
> +   <sys/ucontext.h> includes <sys/procfs.h> includes <sys/user.h>, which
> +   declares "struc user_regs".  */

Even shorter, for instance:

/* This structure is named gdb_user_regs, instead of user_regs, to avoid 
  a comflict with <sys/user.h> defined "struct user_regs" on ARM 
GNU/Linux  (included by: nm-linux.h -> <signal.h> -> <sys/ucontext.h> -> 
<sys/procfs.h>).  */

which is just stating the facts.

Andrew



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-03-09 20:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-28 17:31 [ob] user-regs.c build fix for arm-linux Daniel Jacobowitz
2004-02-28 17:36 ` Andrew Cagney
2004-02-28 18:30   ` Daniel Jacobowitz
2004-02-28 18:49     ` Andrew Cagney
2004-02-29  0:53       ` Daniel Jacobowitz
2004-02-29 16:59       ` Daniel Jacobowitz
2004-03-05  5:23         ` Andrew Cagney
2004-03-19  0:09           ` Andrew Cagney
2004-03-19  0:09         ` Daniel Jacobowitz
2004-03-09 20:05           ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox