diff options
author | Yao Qi <yao.qi@linaro.org> | 2017-07-26 14:24:08 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2017-07-26 14:24:08 +0100 |
commit | 25aa13e522c595cbdbb3868f1daa434a17ba2ab2 (patch) | |
tree | 34f287e234ff4b50267473aa05fce5629358c8bc /gdb/features/i386/32bit-linux.c | |
parent | 6eb1e6a8c1c83d0fb5b06192d1ec218d3a358f23 (diff) | |
download | gdb-25aa13e522c595cbdbb3868f1daa434a17ba2ab2.zip gdb-25aa13e522c595cbdbb3868f1daa434a17ba2ab2.tar.gz gdb-25aa13e522c595cbdbb3868f1daa434a17ba2ab2.tar.bz2 |
Generate c for feature instead of tdesc
This patch changes Makefile and command "maint print c-files" so
that GDB can print c files for features instead target description.
Previously, we feed GDB a target description xml file, which generate
c files including multiple features.
With this patch, in Makefile, we wrap each feature xml file, and
create a temp target description which include only one feature.
Then, adjust the target description printer for them, and print
a c function for each given feature, so that we can use these
c functions later to create target description in a flexible way.
gdb:
2017-07-26 Yao Qi <yao.qi@linaro.org>
* features/Makefile (CFILES): Rename with TDESC_CFILES.
(FEATURE_XMLFILES): New.
(FEATURE_CFILES): New.
New rules.
(clean-cfiles): Remove generated c files.
* features/i386/32bit-avx.c: Generated.
* features/i386/32bit-avx512.c: Generated.
* features/i386/32bit-core.c: Generated.
* features/i386/32bit-linux.c: Generated.
* features/i386/32bit-mpx.c: Generated.
* features/i386/32bit-pkeys.c: Generated.
* features/i386/32bit-sse.c: Generated.
* target-descriptions.c: Include algorithm.
(tdesc_element_visitor): Add method visit_end.
(print_c_tdesc): Implement visit_end.
(print_c_tdesc:: m_filename_after_features): Move it to
protected.
(print_c_feature): New class.
(maint_print_c_tdesc_cmd): Use print_c_feature if XML file
name starts with "i386/32bit-".
Diffstat (limited to 'gdb/features/i386/32bit-linux.c')
-rw-r--r-- | gdb/features/i386/32bit-linux.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/features/i386/32bit-linux.c b/gdb/features/i386/32bit-linux.c new file mode 100644 index 0000000..686a2f1 --- /dev/null +++ b/gdb/features/i386/32bit-linux.c @@ -0,0 +1,14 @@ +/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro: + Original: 32bit-linux.xml */ + +#include "target-descriptions.h" + +static int +create_feature_i386_32bit_linux (struct target_desc *result, long regnum) +{ + struct tdesc_feature *feature; + + feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux"); + tdesc_create_reg (feature, "orig_eax", regnum++, 1, NULL, 32, "int"); + return regnum; +} |