From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4796 invoked by alias); 12 Feb 2016 10:10:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 4772 invoked by uid 89); 12 Feb 2016 10:10:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1398, HContent-Transfer-Encoding:8bit X-HELO: xyzzy.0x04.net Received: from xyzzy.0x04.net (HELO xyzzy.0x04.net) (109.74.193.254) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Feb 2016 10:10:02 +0000 Received: from hogfather.0x04.net (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by xyzzy.0x04.net (Postfix) with ESMTPS id AF9753FE6A; Fri, 12 Feb 2016 11:10:50 +0100 (CET) Received: by hogfather.0x04.net (Postfix, from userid 1000) id 264BE5800A9; Fri, 12 Feb 2016 11:10:00 +0100 (CET) From: =?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?= To: palves@redhat.com Cc: simon.marchi@ericsson.com, gdb-patches@sourceware.org, sergiodj@redhat.com, =?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?= Subject: [PATCH] gdb: Fix build failure in xml-tdesc.c without expat. Date: Fri, 12 Feb 2016 10:10:00 -0000 Message-Id: <1455271799-20446-1-git-send-email-koriakin@0x04.net> In-Reply-To: <56BDAEA4.1030500@redhat.com> References: <56BDAEA4.1030500@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00397.txt.bz2 Introduced by 18d3cec54e1b4fce278dba436484846f8048d7d6. gdb/ChangeLog: * xml-tdesc.c (target_fetch_description_xml): Warn and return NULL when built without expat. --- How about that? gdb/ChangeLog | 5 +++++ gdb/xml-tdesc.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e06fc3c..7e59266 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-02-12 Marcin Kościelnicki + + * xml-tdesc.c (target_fetch_description_xml): Return NULL when + built without expat. + 2016-02-12 Markus Metzger * frame.h (skip_tailcall_frames): Update comment. diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c index 4625b60..b5439e5 100644 --- a/gdb/xml-tdesc.c +++ b/gdb/xml-tdesc.c @@ -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 } -- 2.7.0