mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-05 15:17:13 +08:00

While fiddling a bit with -Wunused-variable, Sergio noticed that "maint print c-tdesc" was always generating code for the "tdesc_type *field_type" variable, even when it wasn't used. This is caught by GCC when using -Wunused-variable, of course. This patch changes the print_c_tdesc class to only output the field declaration when we actually need it. It shouldn't be necessary to do the same with the other variable declarations (type_with_fields and element_type), because they are always if they are declared. The C files in features/ are regenerated, some declarations of field_type are removed, as expected, while some others move to where they are used for the first time. gdb/ChangeLog: * target-descriptions.c (print_c_tdesc) <visit>: Don't output field_type declaration, use printf_field_type_assignment instead. <printf_field_type_assignment>: New method. * features/aarch64-core.c, features/aarch64-fpu.c features/arc-arcompact.c, features/arc-v2.c, features/arm/arm-with-iwmmxt.c, features/i386/32bit-core.c, features/i386/32bit-mpx.c, features/i386/32bit-sse.c, features/i386/64bit-avx512.c, features/i386/64bit-core.c, features/i386/64bit-mpx.c, features/i386/64bit-sse.c, features/i386/x32-core.c, features/or1k.c, features/rs6000/powerpc-7400.c, features/rs6000/powerpc-altivec32.c, features/rs6000/powerpc-altivec32l.c, features/rs6000/powerpc-altivec64.c, features/rs6000/powerpc-altivec64l.c, features/rs6000/powerpc-cell32l.c, features/rs6000/powerpc-cell64l.c, features/rs6000/powerpc-isa205-altivec32l.c, features/rs6000/powerpc-isa205-altivec64l.c, features/rs6000/powerpc-isa205-vsx32l.c, features/rs6000/powerpc-isa205-vsx64l.c, features/rs6000/powerpc-vsx32.c, features/rs6000/powerpc-vsx32l.c, features/rs6000/powerpc-vsx64.c, features/rs6000/powerpc-vsx64l.c, features/s390-gs-linux64.c, features/s390-tevx-linux64.c, features/s390-vx-linux64.c, features/s390x-gs-linux64.c, features/s390x-tevx-linux64.c, features/s390x-vx-linux64.c: Re-generate.
52 lines
2.2 KiB
C
52 lines
2.2 KiB
C
/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
|
|
Original: 32bit-mpx.xml */
|
|
|
|
#include "arch/tdesc.h"
|
|
|
|
static int
|
|
create_feature_i386_32bit_mpx (struct target_desc *result, long regnum)
|
|
{
|
|
struct tdesc_feature *feature;
|
|
|
|
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx", "32bit-mpx.xml");
|
|
tdesc_type_with_fields *type_with_fields;
|
|
type_with_fields = tdesc_create_struct (feature, "br128");
|
|
tdesc_type *field_type;
|
|
field_type = tdesc_named_type (feature, "uint64");
|
|
tdesc_add_field (type_with_fields, "lbound", field_type);
|
|
field_type = tdesc_named_type (feature, "uint64");
|
|
tdesc_add_field (type_with_fields, "ubound_raw", field_type);
|
|
|
|
type_with_fields = tdesc_create_struct (feature, "_bndstatus");
|
|
tdesc_set_struct_size (type_with_fields, 8);
|
|
tdesc_add_bitfield (type_with_fields, "bde", 2, 31);
|
|
tdesc_add_bitfield (type_with_fields, "error", 0, 1);
|
|
|
|
type_with_fields = tdesc_create_union (feature, "status");
|
|
field_type = tdesc_named_type (feature, "data_ptr");
|
|
tdesc_add_field (type_with_fields, "raw", field_type);
|
|
field_type = tdesc_named_type (feature, "_bndstatus");
|
|
tdesc_add_field (type_with_fields, "status", field_type);
|
|
|
|
type_with_fields = tdesc_create_struct (feature, "_bndcfgu");
|
|
tdesc_set_struct_size (type_with_fields, 8);
|
|
tdesc_add_bitfield (type_with_fields, "base", 12, 31);
|
|
tdesc_add_bitfield (type_with_fields, "reserved", 2, 11);
|
|
tdesc_add_bitfield (type_with_fields, "preserved", 1, 1);
|
|
tdesc_add_bitfield (type_with_fields, "enabled", 0, 0);
|
|
|
|
type_with_fields = tdesc_create_union (feature, "cfgu");
|
|
field_type = tdesc_named_type (feature, "data_ptr");
|
|
tdesc_add_field (type_with_fields, "raw", field_type);
|
|
field_type = tdesc_named_type (feature, "_bndcfgu");
|
|
tdesc_add_field (type_with_fields, "config", field_type);
|
|
|
|
tdesc_create_reg (feature, "bnd0raw", regnum++, 1, NULL, 128, "br128");
|
|
tdesc_create_reg (feature, "bnd1raw", regnum++, 1, NULL, 128, "br128");
|
|
tdesc_create_reg (feature, "bnd2raw", regnum++, 1, NULL, 128, "br128");
|
|
tdesc_create_reg (feature, "bnd3raw", regnum++, 1, NULL, 128, "br128");
|
|
tdesc_create_reg (feature, "bndcfgu", regnum++, 1, NULL, 64, "cfgu");
|
|
tdesc_create_reg (feature, "bndstatus", regnum++, 1, NULL, 64, "status");
|
|
return regnum;
|
|
}
|