binutils-gdb/gdb/features/aarch64-core.c

66 lines
3.3 KiB
C
Raw Normal View History

/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
Original: aarch64-core.xml */
#include "common/tdesc.h"
static int
create_feature_aarch64_core (struct target_desc *result, long regnum)
{
struct tdesc_feature *feature;
Remove xml file references from target descriptions gdb/ * common/tdesc.h (tdesc_create_feature): Remove xml filename parameter. * features/aarch64-core.c (create_feature_aarch64_core): Regenerate. * features/aarch64-fpu.c (create_feature_aarch64_fpu): Likewise. * features/i386/32bit-avx.c (create_feature_i386_32bit_avx): Likewise. * features/i386/32bit-avx512.c (create_feature_i386_32bit_avx512): Likewise. * features/i386/32bit-core.c (create_feature_i386_32bit_core): Likewise. * features/i386/32bit-linux.c (create_feature_i386_32bit_linux): Likewise. * features/i386/32bit-mpx.c (create_feature_i386_32bit_mpx): Likewise. * features/i386/32bit-pkeys.c (create_feature_i386_32bit_pkeys): Likewise. * features/i386/32bit-sse.c (create_feature_i386_32bit_sse): Likewise. * features/i386/64bit-avx.c (create_feature_i386_64bit_avx): Likewise. * features/i386/64bit-avx512.c (create_feature_i386_64bit_avx512): Likewise. * features/i386/64bit-core.c (create_feature_i386_64bit_core): Likewise. * features/i386/64bit-linux.c (create_feature_i386_64bit_linux): Likewise. * features/i386/64bit-mpx.c (create_feature_i386_64bit_mpx): Likewise. * features/i386/64bit-pkeys.c (create_feature_i386_64bit_pkeys): Likewise. * features/i386/64bit-segments.c (create_feature_i386_64bit_segments): Likewise. * features/i386/64bit-sse.c (create_feature_i386_64bit_sse): Likewise. * features/i386/x32-core.c (create_feature_i386_x32_core): Likewise. * features/tic6x-c6xp.c (create_feature_tic6x_c6xp): Likewise. * features/tic6x-core.c (create_feature_tic6x_core): Likewise. * features/tic6x-gp.c (create_feature_tic6x_gp): Likewise. * target-descriptions.c: In generated code, don't pass xml filename. gdbserver/ * tdesc.c: Remove xml parameter.
2018-04-19 03:49:37 +08:00
feature = tdesc_create_feature (result, "org.gnu.gdb.aarch64.core");
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.
2017-12-06 05:30:28 +08:00
tdesc_type_with_fields *type_with_fields;
type_with_fields = tdesc_create_flags (feature, "cpsr_flags", 4);
tdesc_add_flag (type_with_fields, 0, "SP");
tdesc_add_flag (type_with_fields, 1, "");
tdesc_add_bitfield (type_with_fields, "EL", 2, 3);
tdesc_add_flag (type_with_fields, 4, "nRW");
tdesc_add_flag (type_with_fields, 5, "");
tdesc_add_flag (type_with_fields, 6, "F");
tdesc_add_flag (type_with_fields, 7, "I");
tdesc_add_flag (type_with_fields, 8, "A");
tdesc_add_flag (type_with_fields, 9, "D");
tdesc_add_flag (type_with_fields, 20, "IL");
tdesc_add_flag (type_with_fields, 21, "SS");
tdesc_add_flag (type_with_fields, 28, "V");
tdesc_add_flag (type_with_fields, 29, "C");
tdesc_add_flag (type_with_fields, 30, "Z");
tdesc_add_flag (type_with_fields, 31, "N");
tdesc_create_reg (feature, "x0", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x1", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x2", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x3", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x4", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x5", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x6", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x7", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x8", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x9", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x10", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x11", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x12", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x13", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x14", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x15", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x16", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x17", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x18", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x19", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x20", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x21", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x22", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x23", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x24", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x25", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x26", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x27", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x28", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x29", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "x30", regnum++, 1, NULL, 64, "int");
tdesc_create_reg (feature, "sp", regnum++, 1, NULL, 64, "data_ptr");
tdesc_create_reg (feature, "pc", regnum++, 1, NULL, 64, "code_ptr");
tdesc_create_reg (feature, "cpsr", regnum++, 1, NULL, 32, "cpsr_flags");
return regnum;
}