aboutsummaryrefslogtreecommitdiff
path: root/gdb/xml-tdesc.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2009-07-20 18:51:42 +0000
committerPedro Alves <palves@redhat.com>2009-07-20 18:51:42 +0000
commit08d1664121e7855d2477854ff1473e82d1731044 (patch)
treee7c913ae91c6d24a95ecc2994a4e6e711da41bab /gdb/xml-tdesc.c
parenta156a290642281359c8dc0c949fdd942826455a1 (diff)
downloadgdb-08d1664121e7855d2477854ff1473e82d1731044.zip
gdb-08d1664121e7855d2477854ff1473e82d1731044.tar.gz
gdb-08d1664121e7855d2477854ff1473e82d1731044.tar.bz2
2009-07-20 Pedro Alves <pedro@codesourcery.com>
* features/gdb-target.dtd (target): Accept an optional 'osabi' element. (osabi): Define element. * features/mips-linux.xml (target): Add an osabi subelement set to GNU/Linux. * regformats/regdat.sh (xmlarch, xmlosabi): New variables. Don't write the architecture into $xmltarget. Store it in $xmlarch. Handle the 'osabi' type. Handle outputting the osabi element of the target description. * regformats/reg-x86-64-linux.dat (osabi): Set to GNU/Linux. * regformats/reg-i386-linux.dat (osabi): Set to GNU/Linux. * target-descriptions.h (tdesc_osabi, set_tdesc_osabi): Declare. * target-descriptions.c (struct target_desc) <osabi>: New field. (tdesc_osabi): New function. (set_tdesc_osabi): New function. * xml-tdesc.c: Include osabi.h. (tdesc_end_osabi): New. (target_children): Parse "osabi" elements. * arch-utils.c (gdbarch_info_fill): Try to get the osabi from the target description if the user didn't override it or it is not extractable from the bfd. If that still fails, fallback to the configured in default. * osabi.h (osabi_from_tdesc_string): Declare. * osabi.c (osabi_from_tdesc_string): New. (gdbarch_lookup_osabi): Return GDB_OSABI_UNKNOWN instead of GDB_OSABI_DEFAULT. * NEWS: Mention that target descriptions can now describe the target OS ABI. 2009-07-20 Pedro Alves <pedro@codesourcery.com> * gdb.texinfo (Target Description Format): Mention the new <osabi> optional element. (subsection OS ABI): New subsection.
Diffstat (limited to 'gdb/xml-tdesc.c')
-rw-r--r--gdb/xml-tdesc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c
index 6987bee..5fd8a41 100644
--- a/gdb/xml-tdesc.c
+++ b/gdb/xml-tdesc.c
@@ -24,6 +24,7 @@
#include "target-descriptions.h"
#include "xml-support.h"
#include "xml-tdesc.h"
+#include "osabi.h"
#include "filenames.h"
@@ -105,6 +106,24 @@ tdesc_end_arch (struct gdb_xml_parser *parser,
set_tdesc_architecture (data->tdesc, arch);
}
+/* Handle the end of an <osabi> element and its value. */
+
+static void
+tdesc_end_osabi (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;
+ enum gdb_osabi osabi;
+
+ osabi = osabi_from_tdesc_string (body_text);
+ if (osabi == GDB_OSABI_UNKNOWN)
+ warning (_("Target description specified unknown osabi \"%s\""),
+ body_text);
+ else
+ set_tdesc_osabi (data->tdesc, osabi);
+}
+
/* Handle the start of a <target> element. */
static void
@@ -313,6 +332,8 @@ static const struct gdb_xml_attribute target_attributes[] = {
static const struct gdb_xml_element target_children[] = {
{ "architecture", NULL, NULL, GDB_XML_EF_OPTIONAL,
NULL, tdesc_end_arch },
+ { "osabi", NULL, NULL, GDB_XML_EF_OPTIONAL,
+ NULL, tdesc_end_osabi },
{ "feature", feature_attributes, feature_children,
GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE,
tdesc_start_feature, NULL },