Allow osabi to be optional in target descriptions
authorAlan Hayward <alan.hayward@arm.com>
Thu, 16 Nov 2017 10:05:21 +0000 (10:05 +0000)
committerAlan Hayward <alan.hayward@arm.com>
Thu, 16 Nov 2017 10:09:17 +0000 (10:09 +0000)
gdbserver/
* tdesc.c (tdesc_get_features_xml): Allow null osabi.

gdb/gdbserver/ChangeLog
gdb/gdbserver/tdesc.c

index 138d6bcf068ae634cb19de3b59ad01bc6f31e590..7e72b7c6e7031c62232068a43d2b595ed19f6b19 100644 (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>
 
        * linux-tic6x-low.c (tic6x_fill_gregset): Cast buf.
index 63d6467d56d168777f4fa39b56495dd5649c046b..e2c4288efba1546247a3b376da3c573c223b6eef 100644 (file)
@@ -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;