From patchwork Fri Oct 17 10:17:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 3260 Received: (qmail 3520 invoked by alias); 17 Oct 2014 10:17:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 3507 invoked by uid 89); 17 Oct 2014 10:17:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 17 Oct 2014 10:17:41 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9HAHXfc029906 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Oct 2014 06:17:33 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9HAHW26015952; Fri, 17 Oct 2014 06:17:33 -0400 Message-ID: <5440ECBC.5060202@redhat.com> Date: Fri, 17 Oct 2014 11:17:32 +0100 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Jiong Wang , "gdb-patches@sourceware.org" Subject: [PATCH] Fix build without libexpat (Re: [PATCH 1/4] Merge remote thread listing methods) References: <1412266896-28210-1-git-send-email-palves@redhat.com> <1412266896-28210-2-git-send-email-palves@redhat.com> <5440D9FB.8000509@arm.com> In-Reply-To: <5440D9FB.8000509@arm.com> Hi Jiong, > looks like this change break arm native build on chrome book. > > clear_threads_listing_context only exist when HAVE_LIBEXPACT defined. Thanks, fixed with the patch below. Though you should really link with libexpat. gdb processes built-in xml files even when native debugging. ---- From 80134cf5b3ca1f75a96af1856fdaad29ad1f57aa Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 17 Oct 2014 11:05:06 +0100 Subject: [PATCH] Fix build without libexpat clear_threads_listing_context is used for thread listing methods other than the xml based, but it's only defined when HAVE_LIBEXPAT is defined. gdb/ 2014-10-17 Pedro Alves * remote.c (clear_threads_listing_context): Move higher up, out of the HAVE_LIBEXPAT guard. --- gdb/ChangeLog | 5 +++++ gdb/remote.c | 30 +++++++++++++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 62d1d06..1ea76a5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-10-17 Pedro Alves + + * remote.c (clear_threads_listing_context): Move higher up, out of + the HAVE_LIBEXPAT guard. + 2014-10-16 Tristan Gingold * i386-darwin-nat.c (i386_darwin_fetch_inferior_registers) diff --git a/gdb/remote.c b/gdb/remote.c index 98d3f2a..20f2988 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2559,6 +2559,21 @@ struct threads_listing_context VEC (thread_item_t) *items; }; +/* Discard the contents of the constructed thread listing context. */ + +static void +clear_threads_listing_context (void *p) +{ + struct threads_listing_context *context = p; + int i; + struct thread_item *item; + + for (i = 0; VEC_iterate (thread_item_t, context->items, i, item); ++i) + xfree (item->extra); + + VEC_free (thread_item_t, context->items); +} + static int remote_newthread_step (threadref *ref, void *data) { @@ -2664,21 +2679,6 @@ const struct gdb_xml_element threads_elements[] = { { NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL } }; -/* Discard the contents of the constructed thread info context. */ - -static void -clear_threads_listing_context (void *p) -{ - struct threads_listing_context *context = p; - int i; - struct thread_item *item; - - for (i = 0; VEC_iterate (thread_item_t, context->items, i, item); ++i) - xfree (item->extra); - - VEC_free (thread_item_t, context->items); -} - #endif /* List remote threads using qXfer:threads:read. */