aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-descriptions.c
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2018-04-18 11:51:21 +0100
committerAlan Hayward <alan.hayward@arm.com>2018-04-18 14:00:43 +0100
commitd278f585afe8e096e9232b8fd80404ab5fae5719 (patch)
tree53550c54565f386592c024088a6f86c9832d59e0 /gdb/target-descriptions.c
parenteee8a18dd2d4b62ed5e03324b099508717886193 (diff)
downloadgdb-d278f585afe8e096e9232b8fd80404ab5fae5719.zip
gdb-d278f585afe8e096e9232b8fd80404ab5fae5719.tar.gz
gdb-d278f585afe8e096e9232b8fd80404ab5fae5719.tar.bz2
Add tdesc osabi and architecture functions
gdb/ * common/tdesc.h (tdesc_architecture_name): Add new declaration. (tdesc_osabi_name): Likewise. * target-descriptions.c (tdesc_architecture_name): Add new function. (tdesc_osabi_name): Likewise. gdbserver/ * tdesc.c (tdesc_architecture_name): Add new function. (tdesc_osabi_name): Likewise. (tdesc_get_features_xml): Use new functions.
Diffstat (limited to 'gdb/target-descriptions.c')
-rw-r--r--gdb/target-descriptions.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 2782ffa..da2c1ce 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -628,6 +628,14 @@ tdesc_architecture (const struct target_desc *target_desc)
return target_desc->arch;
}
+/* See common/tdesc.h. */
+
+const char *
+tdesc_architecture_name (const struct target_desc *target_desc)
+{
+ return target_desc->arch->printable_name;
+}
+
/* Return the OSABI associated with this target description, or
GDB_OSABI_UNKNOWN if no osabi was specified. */
@@ -637,7 +645,16 @@ tdesc_osabi (const struct target_desc *target_desc)
return target_desc->osabi;
}
-
+/* See common/tdesc.h. */
+
+const char *
+tdesc_osabi_name (const struct target_desc *target_desc)
+{
+ enum gdb_osabi osabi = tdesc_osabi (target_desc);
+ if (osabi > GDB_OSABI_UNKNOWN && osabi < GDB_OSABI_INVALID)
+ return gdbarch_osabi_name (osabi);
+ return nullptr;
+}
/* Return 1 if this target description includes any registers. */