diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2017-12-05 16:30:28 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-12-05 16:30:28 -0500 |
commit | d4a0e8b57d6f85e4ee4a31e0e6929ff5b4fd9823 (patch) | |
tree | 0e83717fd7af88d2bef064f8580d8ef57d48e428 /gdb/features/i386 | |
parent | f0cddbef410cb626ea87b3a954bd4e3d7526115e (diff) | |
download | gdb-d4a0e8b57d6f85e4ee4a31e0e6929ff5b4fd9823.zip gdb-d4a0e8b57d6f85e4ee4a31e0e6929ff5b4fd9823.tar.gz gdb-d4a0e8b57d6f85e4ee4a31e0e6929ff5b4fd9823.tar.bz2 |
Split tdesc_type into multiple classes
This patch makes tdesc_type an abstract base class and creates three
subclasses:
- tdesc_type_builtin, for builtin types
- tdesc_type_vector, for vector types
- tdesc_type_with_fields, for struct, union, flag and enum types
This allows getting rid of the union in tdesc_type and to not allow the
std::vector separately. I tried to go further and create separate
classes for struct, union, flag and enum, but it proved too difficult.
One problem is that from the point of the of the target description
code, the types tdesc_type_* are opaque (only forward-declared).
Therefore, it doesn't know about inheritance relationship between those
classes. This makes it impossible to make functions that accept a
pointer to a base class and pass a pointer to a derived class, for
example. I think this patch here is a good compromise, and if somebody
wants to improve things further, the door is open.
A make_gdb_type virtual pure method is added to tdesc_type, which
replaces the current tdesc_gdb_type function. Calling this method on a
tdesc_type returns the corresponding built gdb type.
gdb/ChangeLog:
* target-descriptions.c (struct tdesc_type): Use default
destructor.
<u>: Remove.
<accept>: Remove.
(struct tdesc_type_builtin): New.
(struct tdesc_type_vector): New.
(struct tdesc_type_with_fields): New.
(tdesc_predefined_types): Change type to tdesc_type_builtin[].
(tdesc_gdb_type): Remove.
(tdesc_register_type): Adjust.
(tdesc_create_vector): Create tdesc_type_vector.
(tdesc_create_struct): Create tdesc_type_with_fields.
(tdesc_set_struct_size): Change parameter type.
(tdesc_create_union): Create tdesc_type_with_fields.
(tdesc_create_flags): Likewise.
(tdesc_create_enum): Likewise.
(tdesc_add_field): Change parameter type.
(tdesc_add_typed_bitfield): Likewise.
(tdesc_add_bitfield): Likewise.
(tdesc_add_flag): Likewise.
(tdesc_add_enum_value): Likewise.
(print_c_tdesc) <visit>: Remove overload with tdesc_type
parameter, add overloads for tdesc_type_builtin,
tdesc_type_with_fields and tdesc_type_vector.
<m_printed_type>: Remove.
<m_printed_element_type, m_printed_type_with_fields>: Add.
* target-descriptions.h (tdesc_create_enum): Change return type.
(tdesc_add_typed_bitfield): Change parameter type.
(tdesc_add_enum_value): Change parameter type.
* xml-tdesc.c (struct tdesc_parsing_data) <current_type>: Change
type to tdesc_type_with_fields.
(tdesc_start_struct): Adjust.
(tdesc_start_flags): Adjust.
(tdesc_start_enum): Adjust.
(tdesc_start_field): Adjust.
* arch/tdesc.h (struct tdesc_type_builtin): Forward-declare.
(struct tdesc_type_vector): Forward-declare.
(struct tdesc_type_with_fields): Forward-declare.
(tdesc_create_struct): Change return type.
(tdesc_create_union): Likewise.
(tdesc_create_flags): Likewise.
(tdesc_add_field): Change parameter type.
(tdesc_set_struct_size): Likewise.
(tdesc_add_bitfield): Likewise.
(tdesc_add_flag): Likewise.
* features: Re-generate C files.
gdb/gdbserver/ChangeLog:
* tdesc.c (struct tdesc_type): Change return type.
(tdesc_add_flag): Change parameter type.
(tdesc_add_bitfield): Likewise.
(tdesc_add_field): Likewise.
(tdesc_set_struct_size): Likewise.
Diffstat (limited to 'gdb/features/i386')
-rw-r--r-- | gdb/features/i386/32bit-avx512.c | 6 | ||||
-rw-r--r-- | gdb/features/i386/32bit-core.c | 40 | ||||
-rw-r--r-- | gdb/features/i386/32bit-mpx.c | 42 | ||||
-rw-r--r-- | gdb/features/i386/32bit-sse.c | 75 | ||||
-rw-r--r-- | gdb/features/i386/64bit-avx512.c | 49 | ||||
-rw-r--r-- | gdb/features/i386/64bit-core.c | 40 | ||||
-rw-r--r-- | gdb/features/i386/64bit-mpx.c | 42 | ||||
-rw-r--r-- | gdb/features/i386/64bit-sse.c | 75 | ||||
-rw-r--r-- | gdb/features/i386/x32-core.c | 40 |
9 files changed, 206 insertions, 203 deletions
diff --git a/gdb/features/i386/32bit-avx512.c b/gdb/features/i386/32bit-avx512.c index 82b20c5..39c7e97 100644 --- a/gdb/features/i386/32bit-avx512.c +++ b/gdb/features/i386/32bit-avx512.c @@ -9,9 +9,9 @@ create_feature_i386_32bit_avx512 (struct target_desc *result, long regnum) struct tdesc_feature *feature; feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx512", "32bit-avx512.xml"); - struct tdesc_type *field_type; - field_type = tdesc_named_type (feature, "uint128"); - tdesc_create_vector (feature, "v2ui128", field_type, 2); + tdesc_type *element_type; + element_type = tdesc_named_type (feature, "uint128"); + tdesc_create_vector (feature, "v2ui128", element_type, 2); tdesc_create_reg (feature, "k0", regnum++, 1, NULL, 64, "uint64"); tdesc_create_reg (feature, "k1", regnum++, 1, NULL, 64, "uint64"); diff --git a/gdb/features/i386/32bit-core.c b/gdb/features/i386/32bit-core.c index ec903f3..de2ce47 100644 --- a/gdb/features/i386/32bit-core.c +++ b/gdb/features/i386/32bit-core.c @@ -9,26 +9,26 @@ create_feature_i386_32bit_core (struct target_desc *result, long regnum) struct tdesc_feature *feature; feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core", "32bit-core.xml"); - struct tdesc_type *field_type; - struct tdesc_type *type; - type = tdesc_create_flags (feature, "i386_eflags", 4); - tdesc_add_flag (type, 0, "CF"); - tdesc_add_flag (type, 1, ""); - tdesc_add_flag (type, 2, "PF"); - tdesc_add_flag (type, 4, "AF"); - tdesc_add_flag (type, 6, "ZF"); - tdesc_add_flag (type, 7, "SF"); - tdesc_add_flag (type, 8, "TF"); - tdesc_add_flag (type, 9, "IF"); - tdesc_add_flag (type, 10, "DF"); - tdesc_add_flag (type, 11, "OF"); - tdesc_add_flag (type, 14, "NT"); - tdesc_add_flag (type, 16, "RF"); - tdesc_add_flag (type, 17, "VM"); - tdesc_add_flag (type, 18, "AC"); - tdesc_add_flag (type, 19, "VIF"); - tdesc_add_flag (type, 20, "VIP"); - tdesc_add_flag (type, 21, "ID"); + tdesc_type_with_fields *type_with_fields; + tdesc_type *field_type; + type_with_fields = tdesc_create_flags (feature, "i386_eflags", 4); + tdesc_add_flag (type_with_fields, 0, "CF"); + tdesc_add_flag (type_with_fields, 1, ""); + tdesc_add_flag (type_with_fields, 2, "PF"); + tdesc_add_flag (type_with_fields, 4, "AF"); + tdesc_add_flag (type_with_fields, 6, "ZF"); + tdesc_add_flag (type_with_fields, 7, "SF"); + tdesc_add_flag (type_with_fields, 8, "TF"); + tdesc_add_flag (type_with_fields, 9, "IF"); + tdesc_add_flag (type_with_fields, 10, "DF"); + tdesc_add_flag (type_with_fields, 11, "OF"); + tdesc_add_flag (type_with_fields, 14, "NT"); + tdesc_add_flag (type_with_fields, 16, "RF"); + tdesc_add_flag (type_with_fields, 17, "VM"); + tdesc_add_flag (type_with_fields, 18, "AC"); + tdesc_add_flag (type_with_fields, 19, "VIF"); + tdesc_add_flag (type_with_fields, 20, "VIP"); + tdesc_add_flag (type_with_fields, 21, "ID"); tdesc_create_reg (feature, "eax", regnum++, 1, NULL, 32, "int32"); tdesc_create_reg (feature, "ecx", regnum++, 1, NULL, 32, "int32"); diff --git a/gdb/features/i386/32bit-mpx.c b/gdb/features/i386/32bit-mpx.c index 25a3fb1..38910d3 100644 --- a/gdb/features/i386/32bit-mpx.c +++ b/gdb/features/i386/32bit-mpx.c @@ -9,37 +9,37 @@ 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"); - struct tdesc_type *field_type; - struct tdesc_type *type; - type = tdesc_create_struct (feature, "br128"); + tdesc_type_with_fields *type_with_fields; + tdesc_type *field_type; + type_with_fields = tdesc_create_struct (feature, "br128"); field_type = tdesc_named_type (feature, "uint64"); - tdesc_add_field (type, "lbound", field_type); + tdesc_add_field (type_with_fields, "lbound", field_type); field_type = tdesc_named_type (feature, "uint64"); - tdesc_add_field (type, "ubound_raw", field_type); + tdesc_add_field (type_with_fields, "ubound_raw", field_type); - type = tdesc_create_struct (feature, "_bndstatus"); - tdesc_set_struct_size (type, 8); - tdesc_add_bitfield (type, "bde", 2, 31); - tdesc_add_bitfield (type, "error", 0, 1); + 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 = tdesc_create_union (feature, "status"); + type_with_fields = tdesc_create_union (feature, "status"); field_type = tdesc_named_type (feature, "data_ptr"); - tdesc_add_field (type, "raw", field_type); + tdesc_add_field (type_with_fields, "raw", field_type); field_type = tdesc_named_type (feature, "_bndstatus"); - tdesc_add_field (type, "status", field_type); + tdesc_add_field (type_with_fields, "status", field_type); - type = tdesc_create_struct (feature, "_bndcfgu"); - tdesc_set_struct_size (type, 8); - tdesc_add_bitfield (type, "base", 12, 31); - tdesc_add_bitfield (type, "reserved", 2, 11); - tdesc_add_bitfield (type, "preserved", 1, 1); - tdesc_add_bitfield (type, "enabled", 0, 0); + 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 = tdesc_create_union (feature, "cfgu"); + type_with_fields = tdesc_create_union (feature, "cfgu"); field_type = tdesc_named_type (feature, "data_ptr"); - tdesc_add_field (type, "raw", field_type); + tdesc_add_field (type_with_fields, "raw", field_type); field_type = tdesc_named_type (feature, "_bndcfgu"); - tdesc_add_field (type, "config", field_type); + 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"); diff --git a/gdb/features/i386/32bit-sse.c b/gdb/features/i386/32bit-sse.c index 01b2058..1c8a7e8 100644 --- a/gdb/features/i386/32bit-sse.c +++ b/gdb/features/i386/32bit-sse.c @@ -9,57 +9,58 @@ create_feature_i386_32bit_sse (struct target_desc *result, long regnum) struct tdesc_feature *feature; feature = tdesc_create_feature (result, "org.gnu.gdb.i386.sse", "32bit-sse.xml"); - struct tdesc_type *field_type; - field_type = tdesc_named_type (feature, "ieee_single"); - tdesc_create_vector (feature, "v4f", field_type, 4); + tdesc_type *element_type; + element_type = tdesc_named_type (feature, "ieee_single"); + tdesc_create_vector (feature, "v4f", element_type, 4); - field_type = tdesc_named_type (feature, "ieee_double"); - tdesc_create_vector (feature, "v2d", field_type, 2); + element_type = tdesc_named_type (feature, "ieee_double"); + tdesc_create_vector (feature, "v2d", element_type, 2); - field_type = tdesc_named_type (feature, "int8"); - tdesc_create_vector (feature, "v16i8", field_type, 16); + element_type = tdesc_named_type (feature, "int8"); + tdesc_create_vector (feature, "v16i8", element_type, 16); - field_type = tdesc_named_type (feature, "int16"); - tdesc_create_vector (feature, "v8i16", field_type, 8); + element_type = tdesc_named_type (feature, "int16"); + tdesc_create_vector (feature, "v8i16", element_type, 8); - field_type = tdesc_named_type (feature, "int32"); - tdesc_create_vector (feature, "v4i32", field_type, 4); + element_type = tdesc_named_type (feature, "int32"); + tdesc_create_vector (feature, "v4i32", element_type, 4); - field_type = tdesc_named_type (feature, "int64"); - tdesc_create_vector (feature, "v2i64", field_type, 2); + element_type = tdesc_named_type (feature, "int64"); + tdesc_create_vector (feature, "v2i64", element_type, 2); - struct tdesc_type *type; - type = tdesc_create_union (feature, "vec128"); + tdesc_type_with_fields *type_with_fields; + tdesc_type *field_type; + type_with_fields = tdesc_create_union (feature, "vec128"); field_type = tdesc_named_type (feature, "v4f"); - tdesc_add_field (type, "v4_float", field_type); + tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); - tdesc_add_field (type, "v2_double", field_type); + tdesc_add_field (type_with_fields, "v2_double", field_type); field_type = tdesc_named_type (feature, "v16i8"); - tdesc_add_field (type, "v16_int8", field_type); + tdesc_add_field (type_with_fields, "v16_int8", field_type); field_type = tdesc_named_type (feature, "v8i16"); - tdesc_add_field (type, "v8_int16", field_type); + tdesc_add_field (type_with_fields, "v8_int16", field_type); field_type = tdesc_named_type (feature, "v4i32"); - tdesc_add_field (type, "v4_int32", field_type); + tdesc_add_field (type_with_fields, "v4_int32", field_type); field_type = tdesc_named_type (feature, "v2i64"); - tdesc_add_field (type, "v2_int64", field_type); + tdesc_add_field (type_with_fields, "v2_int64", field_type); field_type = tdesc_named_type (feature, "uint128"); - tdesc_add_field (type, "uint128", field_type); + tdesc_add_field (type_with_fields, "uint128", field_type); - type = tdesc_create_flags (feature, "i386_mxcsr", 4); - tdesc_add_flag (type, 0, "IE"); - tdesc_add_flag (type, 1, "DE"); - tdesc_add_flag (type, 2, "ZE"); - tdesc_add_flag (type, 3, "OE"); - tdesc_add_flag (type, 4, "UE"); - tdesc_add_flag (type, 5, "PE"); - tdesc_add_flag (type, 6, "DAZ"); - tdesc_add_flag (type, 7, "IM"); - tdesc_add_flag (type, 8, "DM"); - tdesc_add_flag (type, 9, "ZM"); - tdesc_add_flag (type, 10, "OM"); - tdesc_add_flag (type, 11, "UM"); - tdesc_add_flag (type, 12, "PM"); - tdesc_add_flag (type, 15, "FZ"); + type_with_fields = tdesc_create_flags (feature, "i386_mxcsr", 4); + tdesc_add_flag (type_with_fields, 0, "IE"); + tdesc_add_flag (type_with_fields, 1, "DE"); + tdesc_add_flag (type_with_fields, 2, "ZE"); + tdesc_add_flag (type_with_fields, 3, "OE"); + tdesc_add_flag (type_with_fields, 4, "UE"); + tdesc_add_flag (type_with_fields, 5, "PE"); + tdesc_add_flag (type_with_fields, 6, "DAZ"); + tdesc_add_flag (type_with_fields, 7, "IM"); + tdesc_add_flag (type_with_fields, 8, "DM"); + tdesc_add_flag (type_with_fields, 9, "ZM"); + tdesc_add_flag (type_with_fields, 10, "OM"); + tdesc_add_flag (type_with_fields, 11, "UM"); + tdesc_add_flag (type_with_fields, 12, "PM"); + tdesc_add_flag (type_with_fields, 15, "FZ"); regnum = 32; tdesc_create_reg (feature, "xmm0", regnum++, 1, NULL, 128, "vec128"); diff --git a/gdb/features/i386/64bit-avx512.c b/gdb/features/i386/64bit-avx512.c index fb50960..a565f42 100644 --- a/gdb/features/i386/64bit-avx512.c +++ b/gdb/features/i386/64bit-avx512.c @@ -9,44 +9,45 @@ create_feature_i386_64bit_avx512 (struct target_desc *result, long regnum) struct tdesc_feature *feature; feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx512", "64bit-avx512.xml"); - struct tdesc_type *field_type; - field_type = tdesc_named_type (feature, "ieee_single"); - tdesc_create_vector (feature, "v4f", field_type, 4); + tdesc_type *element_type; + element_type = tdesc_named_type (feature, "ieee_single"); + tdesc_create_vector (feature, "v4f", element_type, 4); - field_type = tdesc_named_type (feature, "ieee_double"); - tdesc_create_vector (feature, "v2d", field_type, 2); + element_type = tdesc_named_type (feature, "ieee_double"); + tdesc_create_vector (feature, "v2d", element_type, 2); - field_type = tdesc_named_type (feature, "int8"); - tdesc_create_vector (feature, "v16i8", field_type, 16); + element_type = tdesc_named_type (feature, "int8"); + tdesc_create_vector (feature, "v16i8", element_type, 16); - field_type = tdesc_named_type (feature, "int16"); - tdesc_create_vector (feature, "v8i16", field_type, 8); + element_type = tdesc_named_type (feature, "int16"); + tdesc_create_vector (feature, "v8i16", element_type, 8); - field_type = tdesc_named_type (feature, "int32"); - tdesc_create_vector (feature, "v4i32", field_type, 4); + element_type = tdesc_named_type (feature, "int32"); + tdesc_create_vector (feature, "v4i32", element_type, 4); - field_type = tdesc_named_type (feature, "int64"); - tdesc_create_vector (feature, "v2i64", field_type, 2); + element_type = tdesc_named_type (feature, "int64"); + tdesc_create_vector (feature, "v2i64", element_type, 2); - struct tdesc_type *type; - type = tdesc_create_union (feature, "vec128"); + tdesc_type_with_fields *type_with_fields; + tdesc_type *field_type; + type_with_fields = tdesc_create_union (feature, "vec128"); field_type = tdesc_named_type (feature, "v4f"); - tdesc_add_field (type, "v4_float", field_type); + tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); - tdesc_add_field (type, "v2_double", field_type); + tdesc_add_field (type_with_fields, "v2_double", field_type); field_type = tdesc_named_type (feature, "v16i8"); - tdesc_add_field (type, "v16_int8", field_type); + tdesc_add_field (type_with_fields, "v16_int8", field_type); field_type = tdesc_named_type (feature, "v8i16"); - tdesc_add_field (type, "v8_int16", field_type); + tdesc_add_field (type_with_fields, "v8_int16", field_type); field_type = tdesc_named_type (feature, "v4i32"); - tdesc_add_field (type, "v4_int32", field_type); + tdesc_add_field (type_with_fields, "v4_int32", field_type); field_type = tdesc_named_type (feature, "v2i64"); - tdesc_add_field (type, "v2_int64", field_type); + tdesc_add_field (type_with_fields, "v2_int64", field_type); field_type = tdesc_named_type (feature, "uint128"); - tdesc_add_field (type, "uint128", field_type); + tdesc_add_field (type_with_fields, "uint128", field_type); - field_type = tdesc_named_type (feature, "uint128"); - tdesc_create_vector (feature, "v2ui128", field_type, 2); + element_type = tdesc_named_type (feature, "uint128"); + tdesc_create_vector (feature, "v2ui128", element_type, 2); tdesc_create_reg (feature, "xmm16", regnum++, 1, NULL, 128, "vec128"); tdesc_create_reg (feature, "xmm17", regnum++, 1, NULL, 128, "vec128"); diff --git a/gdb/features/i386/64bit-core.c b/gdb/features/i386/64bit-core.c index 14d4a19..f4cad06 100644 --- a/gdb/features/i386/64bit-core.c +++ b/gdb/features/i386/64bit-core.c @@ -9,26 +9,26 @@ create_feature_i386_64bit_core (struct target_desc *result, long regnum) struct tdesc_feature *feature; feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core", "64bit-core.xml"); - struct tdesc_type *field_type; - struct tdesc_type *type; - type = tdesc_create_flags (feature, "i386_eflags", 4); - tdesc_add_flag (type, 0, "CF"); - tdesc_add_flag (type, 1, ""); - tdesc_add_flag (type, 2, "PF"); - tdesc_add_flag (type, 4, "AF"); - tdesc_add_flag (type, 6, "ZF"); - tdesc_add_flag (type, 7, "SF"); - tdesc_add_flag (type, 8, "TF"); - tdesc_add_flag (type, 9, "IF"); - tdesc_add_flag (type, 10, "DF"); - tdesc_add_flag (type, 11, "OF"); - tdesc_add_flag (type, 14, "NT"); - tdesc_add_flag (type, 16, "RF"); - tdesc_add_flag (type, 17, "VM"); - tdesc_add_flag (type, 18, "AC"); - tdesc_add_flag (type, 19, "VIF"); - tdesc_add_flag (type, 20, "VIP"); - tdesc_add_flag (type, 21, "ID"); + tdesc_type_with_fields *type_with_fields; + tdesc_type *field_type; + type_with_fields = tdesc_create_flags (feature, "i386_eflags", 4); + tdesc_add_flag (type_with_fields, 0, "CF"); + tdesc_add_flag (type_with_fields, 1, ""); + tdesc_add_flag (type_with_fields, 2, "PF"); + tdesc_add_flag (type_with_fields, 4, "AF"); + tdesc_add_flag (type_with_fields, 6, "ZF"); + tdesc_add_flag (type_with_fields, 7, "SF"); + tdesc_add_flag (type_with_fields, 8, "TF"); + tdesc_add_flag (type_with_fields, 9, "IF"); + tdesc_add_flag (type_with_fields, 10, "DF"); + tdesc_add_flag (type_with_fields, 11, "OF"); + tdesc_add_flag (type_with_fields, 14, "NT"); + tdesc_add_flag (type_with_fields, 16, "RF"); + tdesc_add_flag (type_with_fields, 17, "VM"); + tdesc_add_flag (type_with_fields, 18, "AC"); + tdesc_add_flag (type_with_fields, 19, "VIF"); + tdesc_add_flag (type_with_fields, 20, "VIP"); + tdesc_add_flag (type_with_fields, 21, "ID"); tdesc_create_reg (feature, "rax", regnum++, 1, NULL, 64, "int64"); tdesc_create_reg (feature, "rbx", regnum++, 1, NULL, 64, "int64"); diff --git a/gdb/features/i386/64bit-mpx.c b/gdb/features/i386/64bit-mpx.c index 2751e03..f8730b4 100644 --- a/gdb/features/i386/64bit-mpx.c +++ b/gdb/features/i386/64bit-mpx.c @@ -9,37 +9,37 @@ create_feature_i386_64bit_mpx (struct target_desc *result, long regnum) struct tdesc_feature *feature; feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx", "64bit-mpx.xml"); - struct tdesc_type *field_type; - struct tdesc_type *type; - type = tdesc_create_struct (feature, "br128"); + tdesc_type_with_fields *type_with_fields; + tdesc_type *field_type; + type_with_fields = tdesc_create_struct (feature, "br128"); field_type = tdesc_named_type (feature, "uint64"); - tdesc_add_field (type, "lbound", field_type); + tdesc_add_field (type_with_fields, "lbound", field_type); field_type = tdesc_named_type (feature, "uint64"); - tdesc_add_field (type, "ubound_raw", field_type); + tdesc_add_field (type_with_fields, "ubound_raw", field_type); - type = tdesc_create_struct (feature, "_bndstatus"); - tdesc_set_struct_size (type, 8); - tdesc_add_bitfield (type, "bde", 2, 63); - tdesc_add_bitfield (type, "error", 0, 1); + type_with_fields = tdesc_create_struct (feature, "_bndstatus"); + tdesc_set_struct_size (type_with_fields, 8); + tdesc_add_bitfield (type_with_fields, "bde", 2, 63); + tdesc_add_bitfield (type_with_fields, "error", 0, 1); - type = tdesc_create_union (feature, "status"); + type_with_fields = tdesc_create_union (feature, "status"); field_type = tdesc_named_type (feature, "data_ptr"); - tdesc_add_field (type, "raw", field_type); + tdesc_add_field (type_with_fields, "raw", field_type); field_type = tdesc_named_type (feature, "_bndstatus"); - tdesc_add_field (type, "status", field_type); + tdesc_add_field (type_with_fields, "status", field_type); - type = tdesc_create_struct (feature, "_bndcfgu"); - tdesc_set_struct_size (type, 8); - tdesc_add_bitfield (type, "base", 12, 63); - tdesc_add_bitfield (type, "reserved", 2, 11); - tdesc_add_bitfield (type, "preserved", 1, 1); - tdesc_add_bitfield (type, "enabled", 0, 0); + type_with_fields = tdesc_create_struct (feature, "_bndcfgu"); + tdesc_set_struct_size (type_with_fields, 8); + tdesc_add_bitfield (type_with_fields, "base", 12, 63); + 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 = tdesc_create_union (feature, "cfgu"); + type_with_fields = tdesc_create_union (feature, "cfgu"); field_type = tdesc_named_type (feature, "data_ptr"); - tdesc_add_field (type, "raw", field_type); + tdesc_add_field (type_with_fields, "raw", field_type); field_type = tdesc_named_type (feature, "_bndcfgu"); - tdesc_add_field (type, "config", field_type); + 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"); diff --git a/gdb/features/i386/64bit-sse.c b/gdb/features/i386/64bit-sse.c index bc38498..e4f99c2 100644 --- a/gdb/features/i386/64bit-sse.c +++ b/gdb/features/i386/64bit-sse.c @@ -9,57 +9,58 @@ create_feature_i386_64bit_sse (struct target_desc *result, long regnum) struct tdesc_feature *feature; feature = tdesc_create_feature (result, "org.gnu.gdb.i386.sse", "64bit-sse.xml"); - struct tdesc_type *field_type; - field_type = tdesc_named_type (feature, "ieee_single"); - tdesc_create_vector (feature, "v4f", field_type, 4); + tdesc_type *element_type; + element_type = tdesc_named_type (feature, "ieee_single"); + tdesc_create_vector (feature, "v4f", element_type, 4); - field_type = tdesc_named_type (feature, "ieee_double"); - tdesc_create_vector (feature, "v2d", field_type, 2); + element_type = tdesc_named_type (feature, "ieee_double"); + tdesc_create_vector (feature, "v2d", element_type, 2); - field_type = tdesc_named_type (feature, "int8"); - tdesc_create_vector (feature, "v16i8", field_type, 16); + element_type = tdesc_named_type (feature, "int8"); + tdesc_create_vector (feature, "v16i8", element_type, 16); - field_type = tdesc_named_type (feature, "int16"); - tdesc_create_vector (feature, "v8i16", field_type, 8); + element_type = tdesc_named_type (feature, "int16"); + tdesc_create_vector (feature, "v8i16", element_type, 8); - field_type = tdesc_named_type (feature, "int32"); - tdesc_create_vector (feature, "v4i32", field_type, 4); + element_type = tdesc_named_type (feature, "int32"); + tdesc_create_vector (feature, "v4i32", element_type, 4); - field_type = tdesc_named_type (feature, "int64"); - tdesc_create_vector (feature, "v2i64", field_type, 2); + element_type = tdesc_named_type (feature, "int64"); + tdesc_create_vector (feature, "v2i64", element_type, 2); - struct tdesc_type *type; - type = tdesc_create_union (feature, "vec128"); + tdesc_type_with_fields *type_with_fields; + tdesc_type *field_type; + type_with_fields = tdesc_create_union (feature, "vec128"); field_type = tdesc_named_type (feature, "v4f"); - tdesc_add_field (type, "v4_float", field_type); + tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); - tdesc_add_field (type, "v2_double", field_type); + tdesc_add_field (type_with_fields, "v2_double", field_type); field_type = tdesc_named_type (feature, "v16i8"); - tdesc_add_field (type, "v16_int8", field_type); + tdesc_add_field (type_with_fields, "v16_int8", field_type); field_type = tdesc_named_type (feature, "v8i16"); - tdesc_add_field (type, "v8_int16", field_type); + tdesc_add_field (type_with_fields, "v8_int16", field_type); field_type = tdesc_named_type (feature, "v4i32"); - tdesc_add_field (type, "v4_int32", field_type); + tdesc_add_field (type_with_fields, "v4_int32", field_type); field_type = tdesc_named_type (feature, "v2i64"); - tdesc_add_field (type, "v2_int64", field_type); + tdesc_add_field (type_with_fields, "v2_int64", field_type); field_type = tdesc_named_type (feature, "uint128"); - tdesc_add_field (type, "uint128", field_type); + tdesc_add_field (type_with_fields, "uint128", field_type); - type = tdesc_create_flags (feature, "i386_mxcsr", 4); - tdesc_add_flag (type, 0, "IE"); - tdesc_add_flag (type, 1, "DE"); - tdesc_add_flag (type, 2, "ZE"); - tdesc_add_flag (type, 3, "OE"); - tdesc_add_flag (type, 4, "UE"); - tdesc_add_flag (type, 5, "PE"); - tdesc_add_flag (type, 6, "DAZ"); - tdesc_add_flag (type, 7, "IM"); - tdesc_add_flag (type, 8, "DM"); - tdesc_add_flag (type, 9, "ZM"); - tdesc_add_flag (type, 10, "OM"); - tdesc_add_flag (type, 11, "UM"); - tdesc_add_flag (type, 12, "PM"); - tdesc_add_flag (type, 15, "FZ"); + type_with_fields = tdesc_create_flags (feature, "i386_mxcsr", 4); + tdesc_add_flag (type_with_fields, 0, "IE"); + tdesc_add_flag (type_with_fields, 1, "DE"); + tdesc_add_flag (type_with_fields, 2, "ZE"); + tdesc_add_flag (type_with_fields, 3, "OE"); + tdesc_add_flag (type_with_fields, 4, "UE"); + tdesc_add_flag (type_with_fields, 5, "PE"); + tdesc_add_flag (type_with_fields, 6, "DAZ"); + tdesc_add_flag (type_with_fields, 7, "IM"); + tdesc_add_flag (type_with_fields, 8, "DM"); + tdesc_add_flag (type_with_fields, 9, "ZM"); + tdesc_add_flag (type_with_fields, 10, "OM"); + tdesc_add_flag (type_with_fields, 11, "UM"); + tdesc_add_flag (type_with_fields, 12, "PM"); + tdesc_add_flag (type_with_fields, 15, "FZ"); regnum = 40; tdesc_create_reg (feature, "xmm0", regnum++, 1, NULL, 128, "vec128"); diff --git a/gdb/features/i386/x32-core.c b/gdb/features/i386/x32-core.c index 3939abc..acafc7d 100644 --- a/gdb/features/i386/x32-core.c +++ b/gdb/features/i386/x32-core.c @@ -9,26 +9,26 @@ create_feature_i386_x32_core (struct target_desc *result, long regnum) struct tdesc_feature *feature; feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core", "x32-core.xml"); - struct tdesc_type *field_type; - struct tdesc_type *type; - type = tdesc_create_flags (feature, "i386_eflags", 4); - tdesc_add_flag (type, 0, "CF"); - tdesc_add_flag (type, 1, ""); - tdesc_add_flag (type, 2, "PF"); - tdesc_add_flag (type, 4, "AF"); - tdesc_add_flag (type, 6, "ZF"); - tdesc_add_flag (type, 7, "SF"); - tdesc_add_flag (type, 8, "TF"); - tdesc_add_flag (type, 9, "IF"); - tdesc_add_flag (type, 10, "DF"); - tdesc_add_flag (type, 11, "OF"); - tdesc_add_flag (type, 14, "NT"); - tdesc_add_flag (type, 16, "RF"); - tdesc_add_flag (type, 17, "VM"); - tdesc_add_flag (type, 18, "AC"); - tdesc_add_flag (type, 19, "VIF"); - tdesc_add_flag (type, 20, "VIP"); - tdesc_add_flag (type, 21, "ID"); + tdesc_type_with_fields *type_with_fields; + tdesc_type *field_type; + type_with_fields = tdesc_create_flags (feature, "i386_eflags", 4); + tdesc_add_flag (type_with_fields, 0, "CF"); + tdesc_add_flag (type_with_fields, 1, ""); + tdesc_add_flag (type_with_fields, 2, "PF"); + tdesc_add_flag (type_with_fields, 4, "AF"); + tdesc_add_flag (type_with_fields, 6, "ZF"); + tdesc_add_flag (type_with_fields, 7, "SF"); + tdesc_add_flag (type_with_fields, 8, "TF"); + tdesc_add_flag (type_with_fields, 9, "IF"); + tdesc_add_flag (type_with_fields, 10, "DF"); + tdesc_add_flag (type_with_fields, 11, "OF"); + tdesc_add_flag (type_with_fields, 14, "NT"); + tdesc_add_flag (type_with_fields, 16, "RF"); + tdesc_add_flag (type_with_fields, 17, "VM"); + tdesc_add_flag (type_with_fields, 18, "AC"); + tdesc_add_flag (type_with_fields, 19, "VIF"); + tdesc_add_flag (type_with_fields, 20, "VIP"); + tdesc_add_flag (type_with_fields, 21, "ID"); tdesc_create_reg (feature, "rax", regnum++, 1, NULL, 64, "int64"); tdesc_create_reg (feature, "rbx", regnum++, 1, NULL, 64, "int64"); |