aboutsummaryrefslogtreecommitdiff
path: root/gdb/xml-tdesc.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-07-31 14:39:12 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-07-31 14:39:12 +0000
commite35359c551b7ae1fb3bf1cdff1c58f3abafa07fb (patch)
tree6d9fbcaaa4c4ba6e30b644179b3c6d13164a8505 /gdb/xml-tdesc.c
parent3a1bae8e7f6b90879682cbcd7391cb8493efb9a1 (diff)
downloadgdb-e35359c551b7ae1fb3bf1cdff1c58f3abafa07fb.zip
gdb-e35359c551b7ae1fb3bf1cdff1c58f3abafa07fb.tar.gz
gdb-e35359c551b7ae1fb3bf1cdff1c58f3abafa07fb.tar.bz2
ChangeLog:
* features/gdb-target.dtd (target): Accept optional <compatible> elements. (compatible): Define element. * target-descriptions.h (tdesc_compatible_p): New. (tdesc_add_compatible): New. * target-descriptions.c (arch_p): New VEC_P type. (struct target_desc): New member compatible. (free_target_description): Handle it. (maint_print_c_tdesc_cmd): Likewise. (tdesc_compatible_p): New function. (tdesc_add_compatible): New function. * xml-tdesc.c (tdesc_end_compatible): New function. (target_children): Handle <compatible> element. * arch-utils.c (choose_architecture_for_target): Accept target description instead of BFD architecture as input. Query target description for compatible architectures. (gdbarch_info_fill): Update call. * NEWS: Mention <compatible> element of target descriptions. doc/ChangeLog: * gdb.texinfo (Target Descriptions): Document <compatible> element.
Diffstat (limited to 'gdb/xml-tdesc.c')
-rw-r--r--gdb/xml-tdesc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c
index 5fd8a41..4fa7843 100644
--- a/gdb/xml-tdesc.c
+++ b/gdb/xml-tdesc.c
@@ -124,6 +124,20 @@ tdesc_end_osabi (struct gdb_xml_parser *parser,
set_tdesc_osabi (data->tdesc, osabi);
}
+/* Handle the end of a <compatible> element and its value. */
+
+static void
+tdesc_end_compatible (struct gdb_xml_parser *parser,
+ const struct gdb_xml_element *element,
+ void *user_data, const char *body_text)
+{
+ struct tdesc_parsing_data *data = user_data;
+ const struct bfd_arch_info *arch;
+
+ arch = bfd_scan_arch (body_text);
+ tdesc_add_compatible (data->tdesc, arch);
+}
+
/* Handle the start of a <target> element. */
static void
@@ -334,6 +348,8 @@ static const struct gdb_xml_element target_children[] = {
NULL, tdesc_end_arch },
{ "osabi", NULL, NULL, GDB_XML_EF_OPTIONAL,
NULL, tdesc_end_osabi },
+ { "compatible", NULL, NULL, GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE,
+ NULL, tdesc_end_compatible },
{ "feature", feature_attributes, feature_children,
GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE,
tdesc_start_feature, NULL },