From d278f585afe8e096e9232b8fd80404ab5fae5719 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Wed, 18 Apr 2018 11:51:21 +0100 Subject: 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. --- gdb/target-descriptions.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'gdb/target-descriptions.c') 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. */ -- cgit v1.1