From: Sergio Durigan Junior Date: Wed, 25 Apr 2012 18:36:05 +0000 (+0000) Subject: 2012-04-25 Sergio Durigan Junior X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e2f8df673369ac03d523aa2ff1ecd11fbf9cb22;p=binutils-gdb.git 2012-04-25 Sergio Durigan Junior * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 874bed95e49..3fea17df1a7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,33 @@ +2012-04-25 Sergio Durigan Junior + + * 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 * cli/cli-cmds.c (cd_command): Use memmove instead of strcpy. diff --git a/gdb/features/arm-with-iwmmxt.c b/gdb/features/arm-with-iwmmxt.c index f3918bb8c99..d3b5fe95de0 100644 --- a/gdb/features/arm-with-iwmmxt.c +++ b/gdb/features/arm-with-iwmmxt.c @@ -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")); diff --git a/gdb/features/arm-with-m-fpa-layout.c b/gdb/features/arm-with-m-fpa-layout.c index ad9b75d8018..6531c3d0966 100644 --- a/gdb/features/arm-with-m-fpa-layout.c +++ b/gdb/features/arm-with-m-fpa-layout.c @@ -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"); diff --git a/gdb/features/arm-with-m.c b/gdb/features/arm-with-m.c index b188f5732ac..2ac3df98012 100644 --- a/gdb/features/arm-with-m.c +++ b/gdb/features/arm-with-m.c @@ -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"); diff --git a/gdb/features/arm-with-neon.c b/gdb/features/arm-with-neon.c index c1eeb0bdf32..d7df4e94d3d 100644 --- a/gdb/features/arm-with-neon.c +++ b/gdb/features/arm-with-neon.c @@ -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"); diff --git a/gdb/features/arm-with-vfpv2.c b/gdb/features/arm-with-vfpv2.c index ad872f8469d..7b014cd0df7 100644 --- a/gdb/features/arm-with-vfpv2.c +++ b/gdb/features/arm-with-vfpv2.c @@ -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"); diff --git a/gdb/features/arm-with-vfpv3.c b/gdb/features/arm-with-vfpv3.c index 2d5b5a82d69..f66524ca1e0 100644 --- a/gdb/features/arm-with-vfpv3.c +++ b/gdb/features/arm-with-vfpv3.c @@ -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"); diff --git a/gdb/features/mips-dsp-linux.c b/gdb/features/mips-dsp-linux.c index 0644cd6dcef..20e4ee35cd0 100644 --- a/gdb/features/mips-dsp-linux.c +++ b/gdb/features/mips-dsp-linux.c @@ -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")); diff --git a/gdb/features/mips-linux.c b/gdb/features/mips-linux.c index 2af6b840217..b0181eb93c9 100644 --- a/gdb/features/mips-linux.c +++ b/gdb/features/mips-linux.c @@ -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")); diff --git a/gdb/features/mips64-dsp-linux.c b/gdb/features/mips64-dsp-linux.c index e8db243d4ab..3e67990b54e 100644 --- a/gdb/features/mips64-dsp-linux.c +++ b/gdb/features/mips64-dsp-linux.c @@ -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")); diff --git a/gdb/features/mips64-linux.c b/gdb/features/mips64-linux.c index 73dce6d06c1..f214d12f09b 100644 --- a/gdb/features/mips64-linux.c +++ b/gdb/features/mips64-linux.c @@ -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")); diff --git a/gdb/features/s390-linux32.c b/gdb/features/s390-linux32.c index 0c5069f9e71..57ade3b092d 100644 --- a/gdb/features/s390-linux32.c +++ b/gdb/features/s390-linux32.c @@ -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")); diff --git a/gdb/features/s390-linux32v1.c b/gdb/features/s390-linux32v1.c index d04641d4b7a..f1637cbcd57 100644 --- a/gdb/features/s390-linux32v1.c +++ b/gdb/features/s390-linux32v1.c @@ -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")); diff --git a/gdb/features/s390-linux32v2.c b/gdb/features/s390-linux32v2.c index 76620f0edf1..75db5487dd9 100644 --- a/gdb/features/s390-linux32v2.c +++ b/gdb/features/s390-linux32v2.c @@ -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")); diff --git a/gdb/features/s390-linux64.c b/gdb/features/s390-linux64.c index b8c4b168784..bd6972e0185 100644 --- a/gdb/features/s390-linux64.c +++ b/gdb/features/s390-linux64.c @@ -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")); diff --git a/gdb/features/s390-linux64v1.c b/gdb/features/s390-linux64v1.c index 0e6865f1107..4936a7fc203 100644 --- a/gdb/features/s390-linux64v1.c +++ b/gdb/features/s390-linux64v1.c @@ -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")); diff --git a/gdb/features/s390-linux64v2.c b/gdb/features/s390-linux64v2.c index 13a6587738f..955b6351a21 100644 --- a/gdb/features/s390-linux64v2.c +++ b/gdb/features/s390-linux64v2.c @@ -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")); diff --git a/gdb/features/s390x-linux64.c b/gdb/features/s390x-linux64.c index 9f95619b43f..9cb89585616 100644 --- a/gdb/features/s390x-linux64.c +++ b/gdb/features/s390x-linux64.c @@ -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")); diff --git a/gdb/features/s390x-linux64v1.c b/gdb/features/s390x-linux64v1.c index b838c347778..c41ff76001d 100644 --- a/gdb/features/s390x-linux64v1.c +++ b/gdb/features/s390x-linux64v1.c @@ -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")); diff --git a/gdb/features/s390x-linux64v2.c b/gdb/features/s390x-linux64v2.c index 90a25d8ee98..fb93d68343e 100644 --- a/gdb/features/s390x-linux64v2.c +++ b/gdb/features/s390x-linux64v2.c @@ -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")); diff --git a/gdb/features/tic6x-c62x-linux.c b/gdb/features/tic6x-c62x-linux.c index df82fc2e77f..288309f4626 100644 --- a/gdb/features/tic6x-c62x-linux.c +++ b/gdb/features/tic6x-c62x-linux.c @@ -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")); diff --git a/gdb/features/tic6x-c62x.c b/gdb/features/tic6x-c62x.c index 6e3a9c80137..0a2f958ef9b 100644 --- a/gdb/features/tic6x-c62x.c +++ b/gdb/features/tic6x-c62x.c @@ -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")); diff --git a/gdb/features/tic6x-c64x-linux.c b/gdb/features/tic6x-c64x-linux.c index 39f9e955a15..59e1ced5ad7 100644 --- a/gdb/features/tic6x-c64x-linux.c +++ b/gdb/features/tic6x-c64x-linux.c @@ -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")); diff --git a/gdb/features/tic6x-c64x.c b/gdb/features/tic6x-c64x.c index 90f178544d1..f0fcdce4072 100644 --- a/gdb/features/tic6x-c64x.c +++ b/gdb/features/tic6x-c64x.c @@ -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")); diff --git a/gdb/features/tic6x-c64xp-linux.c b/gdb/features/tic6x-c64xp-linux.c index a959ec61095..927f8dadd2e 100644 --- a/gdb/features/tic6x-c64xp-linux.c +++ b/gdb/features/tic6x-c64xp-linux.c @@ -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")); diff --git a/gdb/features/tic6x-c64xp.c b/gdb/features/tic6x-c64xp.c index 90cacb9def8..cd4de3aef77 100644 --- a/gdb/features/tic6x-c64xp.c +++ b/gdb/features/tic6x-c64xp.c @@ -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")); diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 0b12e3ea053..16aaa64026b 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -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)