This is the mail archive of the
mailing list for the GDB project.
Re: Reporting the OSABI in target descriptions.
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: "Ulrich Weigand" <uweigand at de dot ibm dot com>, Eli Zaretskii <eliz at gnu dot org>
- Date: Mon, 20 Jul 2009 20:55:00 +0100
- Subject: Re: Reporting the OSABI in target descriptions.
- References: <200907201945.n6KJjP96016621@d12av02.megacenter.de.ibm.com>
On Monday 20 July 2009 20:45:25, Ulrich Weigand wrote:
> Pedro Alves wrote:
> > On Monday 20 July 2009 14:40:56, Pedro Alves wrote:
> > > On Friday 17 July 2009 13:43:35, Ulrich Weigand wrote:
> > >
> > > > I'm wondering whether you're planning to commit your patch soon; this
> > > > would allow me to reconcile the conflicts.
> > >
> > > I saw that Eli had some remarks in the docs parts of the patch. I'll
> > > try to handle those today.
> > >
> > The patch is in now.
> Thanks, Pedro!
> Unfortunately the patch caused a build break for the spu-elf target
> (and presumably others) because it does not define a "default" OS/ABI.
> This causes the GDB_OSABI_DEFAULT macro to remain undefined. The
> existing usage in osabi.c handled this via:
> #ifndef GDB_OSABI_DEFAULT
> #define GDB_OSABI_DEFAULT GDB_OSABI_UNKNOWN
> at the top of the file.
> The new usage your patch introduced in arch-utils.c is not likewise
> protected, causing compilation to fail.
> I've fixed this by the following patch; fixes compilation on spu-elf.
> Committed to mainline.
Moving that ifndef/define/endif to defs.h close to the osabi enum
would avoid such issues and centralise the #ifdefery --- I think I just
assumed that's what was happening, but I can't debug myself now --- , but
it's not worth the bother now, since your patch is certainly fine!
Sorry and thank you!
> * arch-utils.c (gdbarch_info_fill): Only reference GDB_OSABI_DEFAULT
> if the macro is defined.
> Index: src/gdb/arch-utils.c
> --- src.orig/gdb/arch-utils.c
> +++ src/gdb/arch-utils.c
> @@ -731,8 +731,10 @@ gdbarch_info_fill (struct gdbarch_info *
> if (info->osabi == GDB_OSABI_UNKNOWN && info->target_desc != NULL)
> info->osabi = tdesc_osabi (info->target_desc);
> /* From the configured default. */
> +#ifdef GDB_OSABI_DEFAULT
> if (info->osabi == GDB_OSABI_UNKNOWN)
> info->osabi = GDB_OSABI_DEFAULT;
> /* Must have at least filled in the architecture. */
> gdb_assert (info->bfd_arch_info != NULL);