diff options
author | Daniel Jacobowitz <drow@false.org> | 2007-06-13 19:22:35 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2007-06-13 19:22:35 +0000 |
commit | 1780a0edf4903787581db60d46e216acc7c70b37 (patch) | |
tree | 674619ab329cb7d68bf0ec978b4077b9ded52306 /gdb/xml-tdesc.c | |
parent | 98a29c7e2e0b8c73f829745cd802537f839cdbda (diff) | |
download | gdb-1780a0edf4903787581db60d46e216acc7c70b37.zip gdb-1780a0edf4903787581db60d46e216acc7c70b37.tar.gz gdb-1780a0edf4903787581db60d46e216acc7c70b37.tar.bz2 |
* gdb.texinfo (Target Description Format): Add version attribute
for <target>.
* xml-tdesc.c (tdesc_start_target): New.
(target_attributes): New.
(tdesc_elements): Use it.
* features/gdb-target.dtd: Add #FIXED version attribute for
<target>.
Diffstat (limited to 'gdb/xml-tdesc.c')
-rw-r--r-- | gdb/xml-tdesc.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c index 31db9c3..9b2902f 100644 --- a/gdb/xml-tdesc.c +++ b/gdb/xml-tdesc.c @@ -109,6 +109,22 @@ tdesc_end_arch (struct gdb_xml_parser *parser, set_tdesc_architecture (data->tdesc, arch); } +/* Handle the start of a <target> element. */ + +static void +tdesc_start_target (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, VEC(gdb_xml_value_s) *attributes) +{ + struct tdesc_parsing_data *data = user_data; + char *version = VEC_index (gdb_xml_value_s, attributes, 0)->value; + + if (strcmp (version, "1.0") != 0) + gdb_xml_error (parser, + _("Target description has unsupported version \"%s\""), + version); +} + /* Handle the start of a <feature> element. */ static void @@ -328,6 +344,11 @@ static const struct gdb_xml_element feature_children[] = { { NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL } }; +static const struct gdb_xml_attribute target_attributes[] = { + { "version", GDB_XML_AF_NONE, NULL, NULL }, + { NULL, GDB_XML_AF_NONE, NULL, NULL } +}; + static const struct gdb_xml_element target_children[] = { { "architecture", NULL, NULL, GDB_XML_EF_OPTIONAL, NULL, tdesc_end_arch }, @@ -338,8 +359,8 @@ static const struct gdb_xml_element target_children[] = { }; static const struct gdb_xml_element tdesc_elements[] = { - { "target", NULL, target_children, GDB_XML_EF_NONE, - NULL, NULL }, + { "target", target_attributes, target_children, GDB_XML_EF_NONE, + tdesc_start_target, NULL }, { NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL } }; |