From 1d0aa65c24f7c6406718cb506bed912aeec1d5c9 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Thu, 16 Nov 2017 10:05:21 +0000 Subject: [PATCH] Allow osabi to be optional in target descriptions gdbserver/ * tdesc.c (tdesc_get_features_xml): Allow null osabi. --- 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 138d6bcf068..7e72b7c6e70 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,7 @@ +2017-11-16 Alan Hayward + + * tdesc.c (tdesc_get_features_xml): Allow null osabi. + 2017-11-16 Yao Qi * linux-tic6x-low.c (tic6x_fill_gregset): Cast buf. diff --git a/gdb/gdbserver/tdesc.c b/gdb/gdbserver/tdesc.c index 63d6467d56d..e2c4288efba 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 += ""; - buffer += ""; - buffer += tdesc->osabi; - buffer += ""; + if (tdesc->osabi != nullptr) + { + buffer += ""; + buffer += tdesc->osabi; + buffer += ""; + } char *xml; -- 2.30.2