From a6f5ef51d7c85bd0b950fd182284f6cbff5fecf0 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 1 Mar 2010 17:26:03 +0000 Subject: Remove TDESC_TYPE_I386_EFLAGS and TDESC_TYPE_I386_MXCSR. 2010-03-01 H.J. Lu * target-descriptions.c (tdesc_type): Remove TDESC_TYPE_I386_EFLAGS and TDESC_TYPE_I386_MXCSR. (tdesc_predefined_types): Likewise. (tdesc_gdb_type): Likewise. Pass NULL to append_flags_type_flag if flag name is empty. (maint_print_c_tdesc_cmd): Handle TDESC_TYPE_FLAGS. * features/i386/32bit-core.xml: Define i386_eflags. * features/i386/64bit-core.xml: Likewise. * features/i386/32bit-sse.xml: Define i386_mxcsr. * features/i386/64bit-sse.xml: Likewise. * features/i386/amd64-linux.c: Regenerated. * features/i386/amd64.c: Likewise. * features/i386/i386-linux.c: Likewise. * features/i386/i386.c: Likewise. --- gdb/ChangeLog | 20 +++++++++++ gdb/features/i386/32bit-core.xml | 20 +++++++++++ gdb/features/i386/32bit-sse.xml | 16 +++++++++ gdb/features/i386/64bit-core.xml | 20 +++++++++++ gdb/features/i386/64bit-sse.xml | 16 +++++++++ gdb/features/i386/amd64-linux.c | 35 +++++++++++++++++++ gdb/features/i386/amd64.c | 35 +++++++++++++++++++ gdb/features/i386/i386-linux.c | 35 +++++++++++++++++++ gdb/features/i386/i386.c | 35 +++++++++++++++++++ gdb/target-descriptions.c | 73 +++++++++------------------------------- 10 files changed, 248 insertions(+), 57 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bf50dd4..bd07d44 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,23 @@ +2010-03-01 H.J. Lu + + * target-descriptions.c (tdesc_type): Remove + TDESC_TYPE_I386_EFLAGS and TDESC_TYPE_I386_MXCSR. + (tdesc_predefined_types): Likewise. + (tdesc_gdb_type): Likewise. Pass NULL to append_flags_type_flag + if flag name is empty. + (maint_print_c_tdesc_cmd): Handle TDESC_TYPE_FLAGS. + + * features/i386/32bit-core.xml: Define i386_eflags. + * features/i386/64bit-core.xml: Likewise. + + * features/i386/32bit-sse.xml: Define i386_mxcsr. + * features/i386/64bit-sse.xml: Likewise. + + * features/i386/amd64-linux.c: Regenerated. + * features/i386/amd64.c: Likewise. + * features/i386/i386-linux.c: Likewise. + * features/i386/i386.c: Likewise. + 2010-03-01 Daniel Jacobowitz * gdbtypes.c (append_composite_type_field_raw): New. diff --git a/gdb/features/i386/32bit-core.xml b/gdb/features/i386/32bit-core.xml index b047074..4d0377e 100644 --- a/gdb/features/i386/32bit-core.xml +++ b/gdb/features/i386/32bit-core.xml @@ -7,6 +7,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/features/i386/32bit-sse.xml b/gdb/features/i386/32bit-sse.xml index e849b8d..cca94b37 100644 --- a/gdb/features/i386/32bit-sse.xml +++ b/gdb/features/i386/32bit-sse.xml @@ -22,6 +22,22 @@ + + + + + + + + + + + + + + + + diff --git a/gdb/features/i386/64bit-core.xml b/gdb/features/i386/64bit-core.xml index ae41cf2..8cfe3fe 100644 --- a/gdb/features/i386/64bit-core.xml +++ b/gdb/features/i386/64bit-core.xml @@ -7,6 +7,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/features/i386/64bit-sse.xml b/gdb/features/i386/64bit-sse.xml index a71fe78..d7f7925 100644 --- a/gdb/features/i386/64bit-sse.xml +++ b/gdb/features/i386/64bit-sse.xml @@ -22,6 +22,22 @@ + + + + + + + + + + + + + + + + diff --git a/gdb/features/i386/amd64-linux.c b/gdb/features/i386/amd64-linux.c index 64a29ce..71efcbe 100644 --- a/gdb/features/i386/amd64-linux.c +++ b/gdb/features/i386/amd64-linux.c @@ -17,6 +17,25 @@ initialize_tdesc_amd64_linux (void) set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux")); feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core"); + field_type = tdesc_create_flags (feature, "i386_eflags", 4); + tdesc_add_flag (field_type, 0, "CF"); + tdesc_add_flag (field_type, 1, ""); + tdesc_add_flag (field_type, 2, "PF"); + tdesc_add_flag (field_type, 4, "AF"); + tdesc_add_flag (field_type, 6, "ZF"); + tdesc_add_flag (field_type, 7, "SF"); + tdesc_add_flag (field_type, 8, "TF"); + tdesc_add_flag (field_type, 9, "IF"); + tdesc_add_flag (field_type, 10, "DF"); + tdesc_add_flag (field_type, 11, "OF"); + tdesc_add_flag (field_type, 14, "NT"); + tdesc_add_flag (field_type, 16, "RF"); + tdesc_add_flag (field_type, 17, "VM"); + tdesc_add_flag (field_type, 18, "AC"); + tdesc_add_flag (field_type, 19, "VIF"); + tdesc_add_flag (field_type, 20, "VIP"); + tdesc_add_flag (field_type, 21, "ID"); + tdesc_create_reg (feature, "rax", 0, 1, NULL, 64, "int64"); tdesc_create_reg (feature, "rbx", 1, 1, NULL, 64, "int64"); tdesc_create_reg (feature, "rcx", 2, 1, NULL, 64, "int64"); @@ -93,6 +112,22 @@ initialize_tdesc_amd64_linux (void) field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type, "uint128", field_type); + field_type = tdesc_create_flags (feature, "i386_mxcsr", 4); + tdesc_add_flag (field_type, 0, "IE"); + tdesc_add_flag (field_type, 1, "DE"); + tdesc_add_flag (field_type, 2, "ZE"); + tdesc_add_flag (field_type, 3, "OE"); + tdesc_add_flag (field_type, 4, "UE"); + tdesc_add_flag (field_type, 5, "PE"); + tdesc_add_flag (field_type, 6, "DAZ"); + tdesc_add_flag (field_type, 7, "IM"); + tdesc_add_flag (field_type, 8, "DM"); + tdesc_add_flag (field_type, 9, "ZM"); + tdesc_add_flag (field_type, 10, "OM"); + tdesc_add_flag (field_type, 11, "UM"); + tdesc_add_flag (field_type, 12, "PM"); + tdesc_add_flag (field_type, 15, "FZ"); + tdesc_create_reg (feature, "xmm0", 40, 1, NULL, 128, "vec128"); tdesc_create_reg (feature, "xmm1", 41, 1, NULL, 128, "vec128"); tdesc_create_reg (feature, "xmm2", 42, 1, NULL, 128, "vec128"); diff --git a/gdb/features/i386/amd64.c b/gdb/features/i386/amd64.c index af7b729..154e8df 100644 --- a/gdb/features/i386/amd64.c +++ b/gdb/features/i386/amd64.c @@ -15,6 +15,25 @@ initialize_tdesc_amd64 (void) set_tdesc_architecture (result, bfd_scan_arch ("i386:x86-64")); feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core"); + field_type = tdesc_create_flags (feature, "i386_eflags", 4); + tdesc_add_flag (field_type, 0, "CF"); + tdesc_add_flag (field_type, 1, ""); + tdesc_add_flag (field_type, 2, "PF"); + tdesc_add_flag (field_type, 4, "AF"); + tdesc_add_flag (field_type, 6, "ZF"); + tdesc_add_flag (field_type, 7, "SF"); + tdesc_add_flag (field_type, 8, "TF"); + tdesc_add_flag (field_type, 9, "IF"); + tdesc_add_flag (field_type, 10, "DF"); + tdesc_add_flag (field_type, 11, "OF"); + tdesc_add_flag (field_type, 14, "NT"); + tdesc_add_flag (field_type, 16, "RF"); + tdesc_add_flag (field_type, 17, "VM"); + tdesc_add_flag (field_type, 18, "AC"); + tdesc_add_flag (field_type, 19, "VIF"); + tdesc_add_flag (field_type, 20, "VIP"); + tdesc_add_flag (field_type, 21, "ID"); + tdesc_create_reg (feature, "rax", 0, 1, NULL, 64, "int64"); tdesc_create_reg (feature, "rbx", 1, 1, NULL, 64, "int64"); tdesc_create_reg (feature, "rcx", 2, 1, NULL, 64, "int64"); @@ -91,6 +110,22 @@ initialize_tdesc_amd64 (void) field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type, "uint128", field_type); + field_type = tdesc_create_flags (feature, "i386_mxcsr", 4); + tdesc_add_flag (field_type, 0, "IE"); + tdesc_add_flag (field_type, 1, "DE"); + tdesc_add_flag (field_type, 2, "ZE"); + tdesc_add_flag (field_type, 3, "OE"); + tdesc_add_flag (field_type, 4, "UE"); + tdesc_add_flag (field_type, 5, "PE"); + tdesc_add_flag (field_type, 6, "DAZ"); + tdesc_add_flag (field_type, 7, "IM"); + tdesc_add_flag (field_type, 8, "DM"); + tdesc_add_flag (field_type, 9, "ZM"); + tdesc_add_flag (field_type, 10, "OM"); + tdesc_add_flag (field_type, 11, "UM"); + tdesc_add_flag (field_type, 12, "PM"); + tdesc_add_flag (field_type, 15, "FZ"); + tdesc_create_reg (feature, "xmm0", 40, 1, NULL, 128, "vec128"); tdesc_create_reg (feature, "xmm1", 41, 1, NULL, 128, "vec128"); tdesc_create_reg (feature, "xmm2", 42, 1, NULL, 128, "vec128"); diff --git a/gdb/features/i386/i386-linux.c b/gdb/features/i386/i386-linux.c index 37447bd..cc1fb99 100644 --- a/gdb/features/i386/i386-linux.c +++ b/gdb/features/i386/i386-linux.c @@ -17,6 +17,25 @@ initialize_tdesc_i386_linux (void) set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux")); feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core"); + field_type = tdesc_create_flags (feature, "i386_eflags", 4); + tdesc_add_flag (field_type, 0, "CF"); + tdesc_add_flag (field_type, 1, ""); + tdesc_add_flag (field_type, 2, "PF"); + tdesc_add_flag (field_type, 4, "AF"); + tdesc_add_flag (field_type, 6, "ZF"); + tdesc_add_flag (field_type, 7, "SF"); + tdesc_add_flag (field_type, 8, "TF"); + tdesc_add_flag (field_type, 9, "IF"); + tdesc_add_flag (field_type, 10, "DF"); + tdesc_add_flag (field_type, 11, "OF"); + tdesc_add_flag (field_type, 14, "NT"); + tdesc_add_flag (field_type, 16, "RF"); + tdesc_add_flag (field_type, 17, "VM"); + tdesc_add_flag (field_type, 18, "AC"); + tdesc_add_flag (field_type, 19, "VIF"); + tdesc_add_flag (field_type, 20, "VIP"); + tdesc_add_flag (field_type, 21, "ID"); + tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32"); tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32"); tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32"); @@ -88,6 +107,22 @@ initialize_tdesc_i386_linux (void) field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type, "uint128", field_type); + field_type = tdesc_create_flags (feature, "i386_mxcsr", 4); + tdesc_add_flag (field_type, 0, "IE"); + tdesc_add_flag (field_type, 1, "DE"); + tdesc_add_flag (field_type, 2, "ZE"); + tdesc_add_flag (field_type, 3, "OE"); + tdesc_add_flag (field_type, 4, "UE"); + tdesc_add_flag (field_type, 5, "PE"); + tdesc_add_flag (field_type, 6, "DAZ"); + tdesc_add_flag (field_type, 7, "IM"); + tdesc_add_flag (field_type, 8, "DM"); + tdesc_add_flag (field_type, 9, "ZM"); + tdesc_add_flag (field_type, 10, "OM"); + tdesc_add_flag (field_type, 11, "UM"); + tdesc_add_flag (field_type, 12, "PM"); + tdesc_add_flag (field_type, 15, "FZ"); + tdesc_create_reg (feature, "xmm0", 32, 1, NULL, 128, "vec128"); tdesc_create_reg (feature, "xmm1", 33, 1, NULL, 128, "vec128"); tdesc_create_reg (feature, "xmm2", 34, 1, NULL, 128, "vec128"); diff --git a/gdb/features/i386/i386.c b/gdb/features/i386/i386.c index 5ac9ad9..7f7beb3 100644 --- a/gdb/features/i386/i386.c +++ b/gdb/features/i386/i386.c @@ -15,6 +15,25 @@ initialize_tdesc_i386 (void) set_tdesc_architecture (result, bfd_scan_arch ("i386")); feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core"); + field_type = tdesc_create_flags (feature, "i386_eflags", 4); + tdesc_add_flag (field_type, 0, "CF"); + tdesc_add_flag (field_type, 1, ""); + tdesc_add_flag (field_type, 2, "PF"); + tdesc_add_flag (field_type, 4, "AF"); + tdesc_add_flag (field_type, 6, "ZF"); + tdesc_add_flag (field_type, 7, "SF"); + tdesc_add_flag (field_type, 8, "TF"); + tdesc_add_flag (field_type, 9, "IF"); + tdesc_add_flag (field_type, 10, "DF"); + tdesc_add_flag (field_type, 11, "OF"); + tdesc_add_flag (field_type, 14, "NT"); + tdesc_add_flag (field_type, 16, "RF"); + tdesc_add_flag (field_type, 17, "VM"); + tdesc_add_flag (field_type, 18, "AC"); + tdesc_add_flag (field_type, 19, "VIF"); + tdesc_add_flag (field_type, 20, "VIP"); + tdesc_add_flag (field_type, 21, "ID"); + tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32"); tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32"); tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32"); @@ -83,6 +102,22 @@ initialize_tdesc_i386 (void) field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type, "uint128", field_type); + field_type = tdesc_create_flags (feature, "i386_mxcsr", 4); + tdesc_add_flag (field_type, 0, "IE"); + tdesc_add_flag (field_type, 1, "DE"); + tdesc_add_flag (field_type, 2, "ZE"); + tdesc_add_flag (field_type, 3, "OE"); + tdesc_add_flag (field_type, 4, "UE"); + tdesc_add_flag (field_type, 5, "PE"); + tdesc_add_flag (field_type, 6, "DAZ"); + tdesc_add_flag (field_type, 7, "IM"); + tdesc_add_flag (field_type, 8, "DM"); + tdesc_add_flag (field_type, 9, "ZM"); + tdesc_add_flag (field_type, 10, "OM"); + tdesc_add_flag (field_type, 11, "UM"); + tdesc_add_flag (field_type, 12, "PM"); + tdesc_add_flag (field_type, 15, "FZ"); + tdesc_create_reg (feature, "xmm0", 32, 1, NULL, 128, "vec128"); tdesc_create_reg (feature, "xmm1", 33, 1, NULL, 128, "vec128"); tdesc_create_reg (feature, "xmm2", 34, 1, NULL, 128, "vec128"); diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 77dd37b..86adc9d 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -126,8 +126,6 @@ typedef struct tdesc_type TDESC_TYPE_IEEE_DOUBLE, TDESC_TYPE_ARM_FPA_EXT, TDESC_TYPE_I387_EXT, - TDESC_TYPE_I386_EFLAGS, - TDESC_TYPE_I386_MXCSR, /* Types defined by a target feature. */ TDESC_TYPE_VECTOR, @@ -483,9 +481,7 @@ static struct tdesc_type tdesc_predefined_types[] = { "ieee_single", TDESC_TYPE_IEEE_SINGLE }, { "ieee_double", TDESC_TYPE_IEEE_DOUBLE }, { "arm_fpa_ext", TDESC_TYPE_ARM_FPA_EXT }, - { "i387_ext", TDESC_TYPE_I387_EXT }, - { "i386_eflags", TDESC_TYPE_I386_EFLAGS }, - { "i386_mxcsr", TDESC_TYPE_I386_MXCSR } + { "i387_ext", TDESC_TYPE_I387_EXT } }; /* Return the type associated with ID in the context of FEATURE, or @@ -607,57 +603,6 @@ tdesc_gdb_type (struct gdbarch *gdbarch, struct tdesc_type *tdesc_type) return arch_float_type (gdbarch, -1, "builtin_type_i387_ext", floatformats_i387_ext); - case TDESC_TYPE_I386_EFLAGS: - { - struct type *type; - - type = arch_flags_type (gdbarch, "builtin_type_i386_eflags", 4); - append_flags_type_flag (type, 0, "CF"); - append_flags_type_flag (type, 1, NULL); - append_flags_type_flag (type, 2, "PF"); - append_flags_type_flag (type, 4, "AF"); - append_flags_type_flag (type, 6, "ZF"); - append_flags_type_flag (type, 7, "SF"); - append_flags_type_flag (type, 8, "TF"); - append_flags_type_flag (type, 9, "IF"); - append_flags_type_flag (type, 10, "DF"); - append_flags_type_flag (type, 11, "OF"); - append_flags_type_flag (type, 14, "NT"); - append_flags_type_flag (type, 16, "RF"); - append_flags_type_flag (type, 17, "VM"); - append_flags_type_flag (type, 18, "AC"); - append_flags_type_flag (type, 19, "VIF"); - append_flags_type_flag (type, 20, "VIP"); - append_flags_type_flag (type, 21, "ID"); - - return type; - } - break; - - case TDESC_TYPE_I386_MXCSR: - { - struct type *type; - - type = arch_flags_type (gdbarch, "builtin_type_i386_mxcsr", 4); - append_flags_type_flag (type, 0, "IE"); - append_flags_type_flag (type, 1, "DE"); - append_flags_type_flag (type, 2, "ZE"); - append_flags_type_flag (type, 3, "OE"); - append_flags_type_flag (type, 4, "UE"); - append_flags_type_flag (type, 5, "PE"); - append_flags_type_flag (type, 6, "DAZ"); - append_flags_type_flag (type, 7, "IM"); - append_flags_type_flag (type, 8, "DM"); - append_flags_type_flag (type, 9, "ZM"); - append_flags_type_flag (type, 10, "OM"); - append_flags_type_flag (type, 11, "UM"); - append_flags_type_flag (type, 12, "PM"); - append_flags_type_flag (type, 15, "FZ"); - - return type; - } - break; - /* Types defined by a target feature. */ case TDESC_TYPE_VECTOR: { @@ -769,7 +714,8 @@ tdesc_gdb_type (struct gdbarch *gdbarch, struct tdesc_type *tdesc_type) /* Note that contrary to the function name, this call will just set the properties of an already-allocated field. */ - append_flags_type_flag (type, f->start, f->name); + append_flags_type_flag (type, f->start, + *f->name ? f->name : NULL); return type; } @@ -1602,6 +1548,7 @@ maint_print_c_tdesc_cmd (char *args, int from_tty) struct tdesc_reg *reg; struct tdesc_type *type; struct tdesc_type_field *f; + struct tdesc_type_flag *flag; int ix, ix2, ix3; /* Use the global target-supplied description, not the current @@ -1715,6 +1662,18 @@ maint_print_c_tdesc_cmd (char *args, int from_tty) f->name); } break; + case TDESC_TYPE_FLAGS: + printf_unfiltered + (" field_type = tdesc_create_flags (feature, \"%s\", %d);\n", + type->name, (int) type->u.f.size); + for (ix3 = 0; + VEC_iterate (tdesc_type_flag, type->u.f.flags, ix3, + flag); + ix3++) + printf_unfiltered + (" tdesc_add_flag (field_type, %d, \"%s\");\n", + flag->start, flag->name); + break; default: error (_("C output is not supported type \"%s\"."), type->name); } -- cgit v1.1