diff options
author | Yao Qi <yao.qi@linaro.org> | 2017-09-05 09:54:53 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2017-09-05 09:54:53 +0100 |
commit | f49ff00066929bf7c38f9c89ad640561bbb331f6 (patch) | |
tree | b410bbcba3cb5b90d02547b31e4f9efd0c0a7a8f /gdb/target-descriptions.h | |
parent | 2b68ef2f11daef3ab3c6941ebf53dfcd0fb79fbf (diff) | |
download | gdb-f49ff00066929bf7c38f9c89ad640561bbb331f6.zip gdb-f49ff00066929bf7c38f9c89ad640561bbb331f6.tar.gz gdb-f49ff00066929bf7c38f9c89ad640561bbb331f6.tar.bz2 |
[GDBserver] Centralize tdesc for i386-linux
tdesc_i386_XXX_linux is used in many places in linux-x86-low.c and this
patch adds a new function i386_linux_read_description to return the right
tdesc according to xcr0. i386_linux_read_description is quite similar to
the counterpart in GDB, and the following patch will share the duplicated
code, so this patch adds arch/tdesc.h includes the declarations of various
tdesc apis which are used by the shared code. The generated c feature
files can include arch/tdesc.h only.
gdb/gdbserver:
2017-09-05 Yao Qi <yao.qi@linaro.org>
* configure.srv (srv_tgtobj): Append linux-x86-tdesc.o.
(ipa_obj): Likewise.
* linux-i386-ipa.c: Include common/x86-xstate.h
(get_ipa_tdesc): Call i386_linux_read_description.
(initialize_low_tracepoint): Don't call init_registers_XXX
functions, call initialize_low_tdesc instead.
* linux-x86-low.c (x86_linux_read_description): Call
i386_linux_read_description.
(initialize_low_arch): Don't call init_registers_i386_XXX
functions, call initialize_low_tdesc.
* linux-x86-tdesc.c: New file.
* linux-x86-tdesc.h (x86_linux_tdesc): New X86_TDESC_LAST.
(i386_get_ipa_tdesc_idx): Declare.
(i386_get_ipa_tdesc): Declare.
(initialize_low_tdesc): Declare.
gdb:
2017-09-05 Yao Qi <yao.qi@linaro.org>
* arch/tdesc.h: New file.
* regformats/regdat.sh: Generate code using tdesc_create_reg.
* target-descriptions.c: Update comments.
* target-descriptions.h: Include "arch/tdesc.h". Remove the
declarations.
* features/i386/32bit-avx.c: Re-generated.
* features/i386/32bit-avx512.c: Re-generated.
* features/i386/32bit-core.c: Re-generated.
* features/i386/32bit-linux.c: Re-generated.
* features/i386/32bit-mpx.c: Re-generated.
* features/i386/32bit-pkeys.c: Re-generated.
* features/i386/32bit-sse.c: Re-generated.
Diffstat (limited to 'gdb/target-descriptions.h')
-rw-r--r-- | gdb/target-descriptions.h | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/gdb/target-descriptions.h b/gdb/target-descriptions.h index 591da15..c4f9b92 100644 --- a/gdb/target-descriptions.h +++ b/gdb/target-descriptions.h @@ -21,14 +21,10 @@ #ifndef TARGET_DESCRIPTIONS_H #define TARGET_DESCRIPTIONS_H 1 +#include "arch/tdesc.h" -struct tdesc_feature; struct tdesc_arch_data; -struct tdesc_type; -struct tdesc_reg; -struct target_desc; struct target_ops; -struct target_desc; /* An inferior's target description info is stored in this opaque object. There's one such object per inferior. */ struct target_desc_info; @@ -182,12 +178,6 @@ const struct tdesc_feature *tdesc_find_feature (const struct target_desc *, const char *tdesc_feature_name (const struct tdesc_feature *feature); -/* Return the type associated with ID in the context of FEATURE, or - NULL if none. */ - -struct tdesc_type *tdesc_named_type (const struct tdesc_feature *feature, - const char *id); - /* Return the name of register REGNO, from the target description or from an architecture-provided pseudo_register_name method. */ @@ -220,38 +210,14 @@ void set_tdesc_property (struct target_desc *, const char *key, const char *value); void tdesc_add_compatible (struct target_desc *, const struct bfd_arch_info *); - -struct tdesc_feature *tdesc_create_feature (struct target_desc *tdesc, - const char *name); -struct tdesc_type *tdesc_create_vector (struct tdesc_feature *feature, - const char *name, - struct tdesc_type *field_type, - int count); -struct tdesc_type *tdesc_create_struct (struct tdesc_feature *feature, - const char *name); -void tdesc_set_struct_size (struct tdesc_type *type, int size); -struct tdesc_type *tdesc_create_union (struct tdesc_feature *feature, - const char *name); -struct tdesc_type *tdesc_create_flags (struct tdesc_feature *feature, - const char *name, - int size); struct tdesc_type *tdesc_create_enum (struct tdesc_feature *feature, const char *name, int size); -void tdesc_add_field (struct tdesc_type *type, const char *field_name, - struct tdesc_type *field_type); void tdesc_add_typed_bitfield (struct tdesc_type *type, const char *field_name, int start, int end, struct tdesc_type *field_type); -void tdesc_add_bitfield (struct tdesc_type *type, const char *field_name, - int start, int end); -void tdesc_add_flag (struct tdesc_type *type, int start, - const char *flag_name); void tdesc_add_enum_value (struct tdesc_type *type, int value, const char *name); -void tdesc_create_reg (struct tdesc_feature *feature, const char *name, - int regnum, int save_restore, const char *group, - int bitsize, const char *type); #if GDB_SELF_TEST namespace selftests { |