aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
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/gdbserver
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/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/tdesc.c23
2 files changed, 26 insertions, 3 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index a9de2dd..96dc83c 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
2018-04-18 Alan Hayward <alan.hayward@arm.com>
+ * tdesc.c (tdesc_architecture_name): Add new function.
+ (tdesc_osabi_name): Likewise.
+ (tdesc_get_features_xml): Use new functions.
+
+2018-04-18 Alan Hayward <alan.hayward@arm.com>
+
* tdesc.c (tdesc_create_flags): Remove.
(tdesc_add_flag): Likewise.
(tdesc_named_type): Likewise.
diff --git a/gdb/gdbserver/tdesc.c b/gdb/gdbserver/tdesc.c
index aca27ea..7603a90 100644
--- a/gdb/gdbserver/tdesc.c
+++ b/gdb/gdbserver/tdesc.c
@@ -107,6 +107,14 @@ current_target_desc (void)
/* See common/tdesc.h. */
+const char *
+tdesc_architecture_name (const struct target_desc *target_desc)
+{
+ return target_desc->arch;
+}
+
+/* See common/tdesc.h. */
+
void
set_tdesc_architecture (struct target_desc *target_desc,
const char *name)
@@ -116,6 +124,14 @@ set_tdesc_architecture (struct target_desc *target_desc,
/* See common/tdesc.h. */
+const char *
+tdesc_osabi_name (const struct target_desc *target_desc)
+{
+ return target_desc->osabi;
+}
+
+/* See common/tdesc.h. */
+
void
set_tdesc_osabi (struct target_desc *target_desc, const char *name)
{
@@ -140,13 +156,14 @@ tdesc_get_features_xml (target_desc *tdesc)
buffer += "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">";
buffer += "<target>";
buffer += "<architecture>";
- buffer += tdesc->arch;
+ buffer += tdesc_architecture_name (tdesc);
buffer += "</architecture>";
- if (tdesc->osabi != nullptr)
+ const char *osabi = tdesc_osabi_name (tdesc);
+ if (osabi != nullptr)
{
buffer += "<osabi>";
- buffer += tdesc->osabi;
+ buffer += osabi;
buffer += "</osabi>";
}