aboutsummaryrefslogtreecommitdiff
path: root/gdb/regformats
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2018-04-18 20:09:12 +0100
committerAlan Hayward <alan.hayward@arm.com>2018-04-18 20:44:39 +0100
commite98577a9dc4da048ded601920dc6471dcab375aa (patch)
tree375ce804dcb3c8308b95542b7a8e16ed5d4803e1 /gdb/regformats
parentad7fc756d12a841d4b8dd707568426d875e26755 (diff)
downloadfsf-binutils-gdb-e98577a9dc4da048ded601920dc6471dcab375aa.zip
fsf-binutils-gdb-e98577a9dc4da048ded601920dc6471dcab375aa.tar.gz
fsf-binutils-gdb-e98577a9dc4da048ded601920dc6471dcab375aa.tar.bz2
Create xml from target descriptions
Add a print_xml_feature visitor class which turns a target description into xml. Both gdb and gdbserver can do this. gdb/ * common/tdesc.c (print_xml_feature::visit_pre): Add xml parsing. (print_xml_feature::visit_post): Likewise. (print_xml_feature::visit): Likewise. * common/tdesc.h (tdesc_get_features_xml): Use const tdesc. (print_xml_feature): Add new class. * regformats/regdat.sh: Null xmltarget on feature targets. * target-descriptions.c (struct target_desc): Add xmltarget. (maintenance_check_tdesc_xml_convert): Add unittest function. (tdesc_get_features_xml): Add function to get xml. (maintenance_check_xml_descriptions): Test xml generation. * xml-tdesc.c (string_read_description_xml): Add function. * xml-tdesc.h (string_read_description_xml): Add declaration. gdbserver/ * gdb/gdbserver/server.c (get_features_xml): Remove cast. * tdesc.c (void target_desc::accept): Fill in function. (tdesc_get_features_xml): Remove old xml creation. (print_xml_feature::visit_pre): Add xml vistor. * tdesc.h (struct target_desc): Make xmltarget mutable. (tdesc_get_features_xml): Remove declaration.
Diffstat (limited to 'gdb/regformats')
-rwxr-xr-xgdb/regformats/regdat.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/regformats/regdat.sh b/gdb/regformats/regdat.sh
index 18108d7..8f546fe 100755
--- a/gdb/regformats/regdat.sh
+++ b/gdb/regformats/regdat.sh
@@ -163,7 +163,9 @@ done
echo
echo "static const char *expedite_regs_${name}[] = { \"`echo ${expedite} | sed 's/,/", "/g'`\", 0 };"
-if test "${xmltarget}" = x; then
+if test "${feature}" != x; then
+ echo "static const char *xmltarget_${name} = 0;"
+elif test "${xmltarget}" = x; then
if test "${xmlarch}" = x && test "${xmlosabi}" = x; then
echo "static const char *xmltarget_${name} = 0;"
else