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 874bed95e495847e7cff79c166f9d053b66f1bf7..3fea17df1a7fe562f92319c4888c030cefbf5758 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 f3918bb8c994e60f490ed29b269f171cf55fb080..d3b5fe95de04cc7bfbe246aebd75393ebbd81c6a 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 ad9b75d8018aaa0ff1a65d06fb7771eeababa9d7..6531c3d096635ad10a95655a1c299349c9c8bd37 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 b188f5732ac03de130a1cb53d79bbf58fef3ef47..2ac3df98012b4aab5d3e7e39df245743ddf735dd 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 c1eeb0bdf32be5173ae94773e09f536d310a1313..d7df4e94d3d52fb377b826ff90bd0964d854f142 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 ad872f8469d6daf898f630edb74634e141e129f0..7b014cd0df778e4602fc485ad2b01845649294b6 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 2d5b5a82d6940f74a6b2000b751285922a15e803..f66524ca1e07943dcbdd07c69f0dbed4b29403be 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 0644cd6dcefd5a3e3f88bb05d9d43751f5816db3..20e4ee35cd0604a7074b3efa9570544c75fd4161 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 2af6b84021716c9a7dde5c55d1a9a4ebb7a12d23..b0181eb93c9df79233b3bc7bad55cd2387828307 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 e8db243d4ab21130410c3c124e8672d4df73eaf4..3e67990b54ef6636fe7d21e2a6e8618453152de2 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 73dce6d06c121f8245c88a036aedc1e9817154f8..f214d12f09b9851c4811f307d45630fbdf754a6f 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 0c5069f9e71080cd7aa0c803548753edabc4b39c..57ade3b092d96db20db0a7d246633e7b8a6486ea 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 d04641d4b7aad8a37e557df202e5def408238404..f1637cbcd5753470da9619951b54e782c316aa62 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 76620f0edf11405839cf06256cbd1183fe5db3d8..75db5487dd9adfa979212d9212d9fd4daeb2055b 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 b8c4b168784114c2b4dc5ad801eb3acb01153a6e..bd6972e0185c79fc5f30f4af1c96a1fc5c0f2722 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 0e6865f1107c87cb15189e7c31c6b001cf913853..4936a7fc20359c955b795b7b595eedcbb6e421f2 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 13a6587738fae88a75740e2421b58503261bfc19..955b6351a21c7686229af70914d542273aca80e5 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 9f95619b43f7577428a783594de0a4c47ddefb74..9cb895856165a7d686eafc5e50b9c7ff2266f8b8 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 b838c347778a43058b8e1832f853e88bc9291b99..c41ff76001d4a10a8c7675a7182812eb1c47becb 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 90a25d8ee98bec96bc3e4c3b0bbaa6342abbffeb..fb93d68343e99d4bf56f47afbc7b0b91bc1cc096 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 df82fc2e77fd98ee30fdd84d3b5a8852d353b77b..288309f46269334325d0d1894cc695de5cd7f802 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 6e3a9c80137b9523500873d6aeaced1f5c5554ea..0a2f958ef9b67a25ebaf490d0cbed2f0ec7ce74b 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 39f9e955a156102d9b18f42a0932d1b4a02bb6be..59e1ced5ad7593b0cd3ddfa6295fa518f707f3e3 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 90f178544d187e5f45b78ebff7997cd220fc7557..f0fcdce407201fc3f071cd5d4dd1a4e044353177 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 a959ec61095a70ec4993b94ba822ff86c0d4f4d2..927f8dadd2e4934d4c628e0f7e41ae126761edc8 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 90cacb9def844718b17a9e586895dd70084806bb..cd4de3aef770f206cf046819be05b4f521dc46cb 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 0b12e3ea0536bf0bb8841a692b96d9a33ac696a7..16aaa64026bd255d7d7dcd63b3f15daa7738330a 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)