This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Allow osabi to be optional in target descriptions
- From: Alan Hayward <alahay01 at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 16 Nov 2017 10:09:47 -0000
- Subject: [binutils-gdb] Allow osabi to be optional in target descriptions
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1d0aa65c24f7c6406718cb506bed912aeec1d5c9
commit 1d0aa65c24f7c6406718cb506bed912aeec1d5c9
Author: Alan Hayward <alan.hayward@arm.com>
Date: Thu Nov 16 10:05:21 2017 +0000
Allow osabi to be optional in target descriptions
gdbserver/
* tdesc.c (tdesc_get_features_xml): Allow null osabi.
Diff:
---
gdb/gdbserver/ChangeLog | 4 ++++
gdb/gdbserver/tdesc.c | 12 +++++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 138d6bc..7e72b7c 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,7 @@
+2017-11-16 Alan Hayward <alan.hayward@arm.com>
+
+ * tdesc.c (tdesc_get_features_xml): Allow null osabi.
+
2017-11-16 Yao Qi <yao.qi@linaro.org>
* linux-tic6x-low.c (tic6x_fill_gregset): Cast buf.
diff --git a/gdb/gdbserver/tdesc.c b/gdb/gdbserver/tdesc.c
index 63d6467..e2c4288 100644
--- a/gdb/gdbserver/tdesc.c
+++ b/gdb/gdbserver/tdesc.c
@@ -92,8 +92,7 @@ tdesc_get_features_xml (target_desc *tdesc)
/* Either .xmltarget or .features is not NULL. */
gdb_assert (tdesc->xmltarget != NULL
|| (tdesc->features != NULL
- && tdesc->arch != NULL
- && tdesc->osabi != NULL));
+ && tdesc->arch != NULL));
if (tdesc->xmltarget == NULL)
{
@@ -105,9 +104,12 @@ tdesc_get_features_xml (target_desc *tdesc)
buffer += tdesc->arch;
buffer += "</architecture>";
- buffer += "<osabi>";
- buffer += tdesc->osabi;
- buffer += "</osabi>";
+ if (tdesc->osabi != nullptr)
+ {
+ buffer += "<osabi>";
+ buffer += tdesc->osabi;
+ buffer += "</osabi>";
+ }
char *xml;