summaryrefslogtreecommitdiff
path: root/gdb/target-descriptions.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2009-07-20 18:51:40 +0000
committerPedro Alves <pedro@codesourcery.com>2009-07-20 18:51:40 +0000
commit18e1bea42e50d26c3c7287f11ac48da1d86063f6 (patch)
treecccf0f48c4ecf64a6170e0b85d7c904e7f30f9c1 /gdb/target-descriptions.c
parent729d9a2617626353593b943452d678025f094e56 (diff)
downloadgdb-18e1bea42e50d26c3c7287f11ac48da1d86063f6.tar.gz
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/target-descriptions.c')
-rw-r--r--gdb/target-descriptions.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 741ea655b8a..88cc7e0442d 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -165,6 +165,10 @@ struct target_desc
/* The architecture reported by the target, if any. */
const struct bfd_arch_info *arch;
+ /* The osabi reported by the target, if any; GDB_OSABI_UNKNOWN
+ otherwise. */
+ enum gdb_osabi osabi;
+
/* Any architecture-specific properties specified by the target. */
VEC(property_s) *properties;
@@ -351,6 +355,16 @@ tdesc_architecture (const struct target_desc *target_desc)
{
return target_desc->arch;
}
+
+/* Return the OSABI associated with this target description, or
+ GDB_OSABI_UNKNOWN if no osabi was specified. */
+
+enum gdb_osabi
+tdesc_osabi (const struct target_desc *target_desc)
+{
+ return target_desc->osabi;
+}
+
/* Return 1 if this target description includes any registers. */
@@ -1161,6 +1175,12 @@ set_tdesc_architecture (struct target_desc *target_desc,
{
target_desc->arch = arch;
}
+
+void
+set_tdesc_osabi (struct target_desc *target_desc, enum gdb_osabi osabi)
+{
+ target_desc->osabi = osabi;
+}
static struct cmd_list_element *tdesc_set_cmdlist, *tdesc_show_cmdlist;