gdb: Fix build failure in xml-tdesc.c without expat.
authorMarcin Kościelnicki <koriakin@0x04.net>
Thu, 11 Feb 2016 22:52:44 +0000 (23:52 +0100)
committerMarcin Kościelnicki <koriakin@0x04.net>
Fri, 12 Feb 2016 10:21:00 +0000 (11:21 +0100)
Introduced by 18d3cec54e1b4fce278dba436484846f8048d7d6.

gdb/ChangeLog:

* xml-tdesc.c (target_fetch_description_xml) [!HAVE_LIBEXPAT]: Warn
and return NULL.

gdb/ChangeLog
gdb/xml-tdesc.c

index e06fc3cc681e50cbc16e94179a39239674099cc8..4e8dfb54f6c111a491dbc17bec918bcdadea9a69 100644 (file)
@@ -1,3 +1,8 @@
+2016-02-12  Marcin Kościelnicki  <koriakin@0x04.net>
+
+       * xml-tdesc.c (target_fetch_description_xml) [!HAVE_LIBEXPAT]: Warn
+       and return NULL.
+
 2016-02-12  Markus Metzger  <markus.t.metzger@intel.com>
 
        * frame.h (skip_tailcall_frames): Update comment.
index 4625b60311bfd955255108cd526c9397a501bb1b..b5439e567bbea3b80a64cda82a225db5547c9dfd 100644 (file)
@@ -638,6 +638,18 @@ target_read_description_xml (struct target_ops *ops)
 char *
 target_fetch_description_xml (struct target_ops *ops)
 {
+#if !defined(HAVE_LIBEXPAT)
+  static int have_warned;
+
+  if (!have_warned)
+    {
+      have_warned = 1;
+      warning (_("Can not fetch XML target description; XML support was "
+                "disabled at compile time"));
+    }
+
+  return NULL;
+#else
   struct target_desc *tdesc;
   char *tdesc_str;
   char *expanded_text;
@@ -659,4 +671,5 @@ target_fetch_description_xml (struct target_ops *ops)
     }
 
   return expanded_text;
+#endif
 }