This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch]Clean up the XML files for ARM


On 06/22/2014 05:35 AM, Terry Guo wrote:
> rename from gdb/features/arm-with-m-vfp-d16.c
> rename to gdb/features/arm/with-m-vfp-d16.c
> index a0da583..5f47e3d 100644
> --- a/gdb/features/arm-with-m-vfp-d16.c
> +++ b/gdb/features/arm/with-m-vfp-d16.c
> @@ -1,13 +1,13 @@
>  /* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
> -  Original: arm-with-m-vfp-d16.xml */
> +  Original: with-m-vfp-d16.xml */

Thank you.

However, I've just now realized a design problem with
losing the prefixes all over...  :-(

> -struct target_desc *tdesc_arm_with_m_vfp_d16;
> +struct target_desc *tdesc_with_m_vfp_d16;
>  static void
> -initialize_tdesc_arm_with_m_vfp_d16 (void)
> +initialize_tdesc_with_m_vfp_d16 (void)
>  {

Losing the prefix in the generated code is problematic for
multi-arch (--enable-target=all) builds, because this way we're
open for conflict between archs.  E.g., say we have

 arch1/linux.xml
 arch1/linux.c
 arch2/linux.xml
 arch2/linux.c

Then we end up with multiple conflicting definitions of
"struct target_desc *tdesc_linux;"

I think we should fix this by making the directory name be a prefix
in the generated code.  That is, in the ARM case, these hunks would
disappear from your patch:

> -struct target_desc *tdesc_arm_with_m_vfp_d16;
> +struct target_desc *tdesc_with_m_vfp_d16;
>  static void
> -initialize_tdesc_arm_with_m_vfp_d16 (void)
> +initialize_tdesc_with_m_vfp_d16 (void)
>  {

Would you like to work on this?

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]