Reporting the OSABI in target descriptions.

Pedro Alves pedro@codesourcery.com
Mon Jul 20 21:06:00 GMT 2009


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
> #endif
> at the top of the file.
> 

D'oh!

> 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!

> 
> Bye,
> Ulrich
> 
> ChangeLog:
> 
> 	* 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;
> +#endif
>  
>    /* Must have at least filled in the architecture.  */
>    gdb_assert (info->bfd_arch_info != NULL);
> 
> 
> 



-- 
Pedro Alves



More information about the Gdb-patches mailing list