Allow osabi to be optional in target descriptions

gdbserver/
	* tdesc.c (tdesc_get_features_xml): Allow null osabi.
This commit is contained in:
Alan Hayward
2017-11-16 10:05:21 +00:00
parent 3491a34c4f
commit 1d0aa65c24
2 changed files with 11 additions and 5 deletions

View File

@ -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> 2017-11-16 Yao Qi <yao.qi@linaro.org>
* linux-tic6x-low.c (tic6x_fill_gregset): Cast buf. * linux-tic6x-low.c (tic6x_fill_gregset): Cast buf.

View File

@ -92,8 +92,7 @@ tdesc_get_features_xml (target_desc *tdesc)
/* Either .xmltarget or .features is not NULL. */ /* Either .xmltarget or .features is not NULL. */
gdb_assert (tdesc->xmltarget != NULL gdb_assert (tdesc->xmltarget != NULL
|| (tdesc->features != NULL || (tdesc->features != NULL
&& tdesc->arch != NULL && tdesc->arch != NULL));
&& tdesc->osabi != NULL));
if (tdesc->xmltarget == NULL) if (tdesc->xmltarget == NULL)
{ {
@ -105,9 +104,12 @@ tdesc_get_features_xml (target_desc *tdesc)
buffer += tdesc->arch; buffer += tdesc->arch;
buffer += "</architecture>"; buffer += "</architecture>";
buffer += "<osabi>"; if (tdesc->osabi != nullptr)
buffer += tdesc->osabi; {
buffer += "</osabi>"; buffer += "<osabi>";
buffer += tdesc->osabi;
buffer += "</osabi>";
}
char *xml; char *xml;