From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31748 invoked by alias); 28 Feb 2004 17:31:23 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 31741 invoked from network); 28 Feb 2004 17:31:22 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 28 Feb 2004 17:31:22 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1Ax8J7-00045Q-Ks for ; Sat, 28 Feb 2004 12:31:21 -0500 Date: Sat, 28 Feb 2004 17:31:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: [ob] user-regs.c build fix for arm-linux Message-ID: <20040228173121.GA15679@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.1i X-SW-Source: 2004-02/txt/msg00829.txt.bz2 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 * 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 = ®s->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) {