2012-04-25 Sergio Durigan Junior <sergiodj@redhat.com>
authorSergio Durigan Junior <sergiodj@redhat.com>
Wed, 25 Apr 2012 18:36:05 +0000 (18:36 +0000)
committerSergio Durigan Junior <sergiodj@redhat.com>
Wed, 25 Apr 2012 18:36:05 +0000 (18:36 +0000)
* features/arm-with-iwmmxt.c: Regenerate.
* features/arm-with-m-fpa-layout.c: Likewise.
* features/arm-with-m.c: Likewise.
* features/arm-with-neon.c: Likewise.
* features/arm-with-vfpv2.c: Likewise.
* features/arm-with-vfpv3.c: Likewise.
* features/mips-dsp-linux.c: Likewise.
* features/mips-linux.c: Likewise.
* features/mips64-dsp-linux.c: Likewise.
* features/mips64-linux.c: Likewise.
* features/s390-linux32.c: Likewise.
* features/s390-linux32v1.c: Likewise.
* features/s390-linux32v2.c: Likewise.
* features/s390-linux64.c: Likewise.
* features/s390-linux64v1.c: Likewise.
* features/s390-linux64v2.c: Likewise.
* features/s390x-linux64.c: Likewise.
* features/s390x-linux64v1.c: Likewise.
* features/s390x-linux64v2.c: Likewise.
* features/tic6x-c62x-linux.c: Likewise.
* features/tic6x-c62x.c: Likewise.
* features/tic6x-c64x-linux.c: Likewise.
* features/tic6x-c64x.c: Likewise.
* features/tic6x-c64xp-linux.c: Likewise.
* features/tic6x-c64xp.c: Likewise.
* target-descriptions.c: Only generate `field_type' and `type'
variables when needed.

27 files changed:
gdb/ChangeLog
gdb/features/arm-with-iwmmxt.c
gdb/features/arm-with-m-fpa-layout.c
gdb/features/arm-with-m.c
gdb/features/arm-with-neon.c
gdb/features/arm-with-vfpv2.c
gdb/features/arm-with-vfpv3.c
gdb/features/mips-dsp-linux.c
gdb/features/mips-linux.c
gdb/features/mips64-dsp-linux.c
gdb/features/mips64-linux.c
gdb/features/s390-linux32.c
gdb/features/s390-linux32v1.c
gdb/features/s390-linux32v2.c
gdb/features/s390-linux64.c
gdb/features/s390-linux64v1.c
gdb/features/s390-linux64v2.c
gdb/features/s390x-linux64.c
gdb/features/s390x-linux64v1.c
gdb/features/s390x-linux64v2.c
gdb/features/tic6x-c62x-linux.c
gdb/features/tic6x-c62x.c
gdb/features/tic6x-c64x-linux.c
gdb/features/tic6x-c64x.c
gdb/features/tic6x-c64xp-linux.c
gdb/features/tic6x-c64xp.c
gdb/target-descriptions.c

index 874bed9..3fea17d 100644 (file)
@@ -1,3 +1,33 @@
+2012-04-25  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+       * features/arm-with-iwmmxt.c: Regenerate.
+       * features/arm-with-m-fpa-layout.c: Likewise.
+       * features/arm-with-m.c: Likewise.
+       * features/arm-with-neon.c: Likewise.
+       * features/arm-with-vfpv2.c: Likewise.
+       * features/arm-with-vfpv3.c: Likewise.
+       * features/mips-dsp-linux.c: Likewise.
+       * features/mips-linux.c: Likewise.
+       * features/mips64-dsp-linux.c: Likewise.
+       * features/mips64-linux.c: Likewise.
+       * features/s390-linux32.c: Likewise.
+       * features/s390-linux32v1.c: Likewise.
+       * features/s390-linux32v2.c: Likewise.
+       * features/s390-linux64.c: Likewise.
+       * features/s390-linux64v1.c: Likewise.
+       * features/s390-linux64v2.c: Likewise.
+       * features/s390x-linux64.c: Likewise.
+       * features/s390x-linux64v1.c: Likewise.
+       * features/s390x-linux64v2.c: Likewise.
+       * features/tic6x-c62x-linux.c: Likewise.
+       * features/tic6x-c62x.c: Likewise.
+       * features/tic6x-c64x-linux.c: Likewise.
+       * features/tic6x-c64x.c: Likewise.
+       * features/tic6x-c64xp-linux.c: Likewise.
+       * features/tic6x-c64xp.c: Likewise.
+       * target-descriptions.c: Only generate `field_type' and `type'
+       variables when needed.
+
 2012-04-25  Fredrik Hederstierna  <fredrikh.hederstierna@securitas-direct.com>
 
        * cli/cli-cmds.c (cd_command): Use memmove instead of strcpy.
index f3918bb..d3b5fe9 100644 (file)
@@ -10,7 +10,8 @@ initialize_tdesc_arm_with_iwmmxt (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
+  struct tdesc_type *field_type;
+  struct tdesc_type *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("iwmmxt"));
 
index ad9b75d..6531c3d 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_arm_with_m_fpa_layout (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-profile");
   tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
index b188f57..2ac3df9 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_arm_with_m (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-profile");
   tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
index c1eeb0b..d7df4e9 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_arm_with_neon (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.arm.core");
   tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
index ad872f8..7b014cd 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_arm_with_vfpv2 (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.arm.core");
   tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
index 2d5b5a8..f66524c 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_arm_with_vfpv3 (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   feature = tdesc_create_feature (result, "org.gnu.gdb.arm.core");
   tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
index 0644cd6..20e4ee3 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_mips_dsp_linux (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("mips"));
 
index 2af6b84..b0181eb 100644 (file)
@@ -9,7 +9,6 @@ initialize_tdesc_mips_linux (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("mips"));
 
index e8db243..3e67990 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_mips64_dsp_linux (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("mips"));
 
index 73dce6d..f214d12 100644 (file)
@@ -9,7 +9,6 @@ initialize_tdesc_mips64_linux (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("mips"));
 
index 0c5069f..57ade3b 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_s390_linux32 (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("s390:31-bit"));
 
index d04641d..f1637cb 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_s390_linux32v1 (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("s390:31-bit"));
 
index 76620f0..75db548 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_s390_linux32v2 (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("s390:31-bit"));
 
index b8c4b16..bd6972e 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_s390_linux64 (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("s390:31-bit"));
 
index 0e6865f..4936a7f 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_s390_linux64v1 (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("s390:31-bit"));
 
index 13a6587..955b635 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_s390_linux64v2 (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("s390:31-bit"));
 
index 9f95619..9cb8958 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_s390x_linux64 (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("s390:64-bit"));
 
index b838c34..c41ff76 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_s390x_linux64v1 (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("s390:64-bit"));
 
index 90a25d8..fb93d68 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_s390x_linux64v2 (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("s390:64-bit"));
 
index df82fc2..288309f 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_tic6x_c62x_linux (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("tic6x"));
 
index 6e3a9c8..0a2f958 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_tic6x_c62x (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("tic6x"));
 
index 39f9e95..59e1ced 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_tic6x_c64x_linux (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("tic6x"));
 
index 90f1785..f0fcdce 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_tic6x_c64x (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("tic6x"));
 
index a959ec6..927f8da 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_tic6x_c64xp_linux (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("tic6x"));
 
index 90cacb9..cd4de3a 100644 (file)
@@ -10,7 +10,6 @@ initialize_tdesc_tic6x_c64xp (void)
 {
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
-  struct tdesc_type *field_type, *type;
 
   set_tdesc_architecture (result, bfd_scan_arch ("tic6x"));
 
index 0b12e3e..16aaa64 100644 (file)
@@ -1550,6 +1550,7 @@ maint_print_c_tdesc_cmd (char *args, int from_tty)
   struct tdesc_type_field *f;
   struct tdesc_type_flag *flag;
   int ix, ix2, ix3;
+  int printed_field_type = 0;
 
   /* Use the global target-supplied description, not the current
      architecture's.  This lets a GDB for one architecture generate C
@@ -1588,7 +1589,39 @@ maint_print_c_tdesc_cmd (char *args, int from_tty)
   printf_unfiltered
     ("  struct target_desc *result = allocate_target_description ();\n");
   printf_unfiltered ("  struct tdesc_feature *feature;\n");
-  printf_unfiltered ("  struct tdesc_type *field_type, *type;\n");
+
+  /* Now we do some "filtering" in order to know which variables to
+     declare.  This is needed because otherwise we would declare unused
+     variables `field_type' and `type'.  */
+  for (ix = 0;
+       VEC_iterate (tdesc_feature_p, tdesc->features, ix, feature);
+       ix++)
+    {
+      int printed_desc_type = 0;
+
+      for (ix2 = 0;
+          VEC_iterate (tdesc_type_p, feature->types, ix2, type);
+          ix2++)
+       {
+         if (!printed_field_type)
+           {
+             printf_unfiltered ("  struct tdesc_type *field_type;\n");
+             printed_field_type = 1;
+           }
+
+         if (type->kind == TDESC_TYPE_UNION
+             && VEC_length (tdesc_type_field, type->u.u.fields) > 0)
+           {
+             printf_unfiltered ("  struct tdesc_type *type;\n");
+             printed_desc_type = 1;
+             break;
+           }
+       }
+
+      if (printed_desc_type)
+       break;
+    }
+
   printf_unfiltered ("\n");
 
   if (tdesc_architecture (tdesc) != NULL)