From patchwork Fri Nov 27 15:16:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 9840 Received: (qmail 70309 invoked by alias); 27 Nov 2015 15:16: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 70298 invoked by uid 89); 27 Nov 2015 15:16:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 27 Nov 2015 15:16:38 +0000 Received: from EUSAAHC005.ericsson.se (Unknown_Domain [147.117.188.87]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id F1.A8.32102.2D378565; Fri, 27 Nov 2015 16:16:35 +0100 (CET) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.89) with Microsoft SMTP Server id 14.3.248.2; Fri, 27 Nov 2015 10:16:35 -0500 Subject: Re: [PATCH v2 2/3] Display names of remote threads To: Yao Qi References: <1448488138-2360-1-git-send-email-simon.marchi@ericsson.com> <1448488138-2360-3-git-send-email-simon.marchi@ericsson.com> <5656EDB8.8030803@redhat.com> <56572AA0.9070904@ericsson.com> <86mvtzv78l.fsf@gmail.com> CC: Pedro Alves , From: Simon Marchi Message-ID: <565873D3.3040002@ericsson.com> Date: Fri, 27 Nov 2015 10:16:35 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <86mvtzv78l.fsf@gmail.com> X-IsSubscribed: yes On 15-11-27 09:37 AM, Yao Qi wrote: > Simon Marchi writes: > >> + attr = xml_find_attribute (attributes, "name"); >> + item.name = attr != NULL ? xstrdup (attr->value) : NULL; >> + > > This breaks the C++ build, > > /home/yao/SourceCode/gnu/gdb/git/gdb/remote.c: In function ‘void start_thread(gdb_xml_parser*, const gdb_xml_element*, void*, VEC_gdb_xml_value_s*)’: > /home/yao/SourceCode/gnu/gdb/git/gdb/remote.c:2975:50: error: invalid conversion from ‘void*’ to ‘const char*’ [-fpermissive] > item.name = attr != NULL ? xstrdup (attr->value) : NULL; > ^ > In file included from /home/yao/SourceCode/gnu/gdb/git/gdb/common/common-defs.h:64:0, > from /home/yao/SourceCode/gnu/gdb/git/gdb/defs.h:28, > from /home/yao/SourceCode/gnu/gdb/git/gdb/remote.c:22: > /home/yao/SourceCode/gnu/gdb/git/gdb/../include/libiberty.h:323:14: note: initializing argument 1 of ‘char* xstrdup(const char*)’ > extern char *xstrdup (const char *) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL; > > and I think you've already received the mail from buildbot. > http://gdb-build.sergiodj.net/builders/Fedora-x86_64-cxx-build-m64/builds/1413 > Ahh, silly me, I didn't try to build with C++. Strange, I didn't receive anything from Buildbot. I just pushed this to fix it: From e19616610d7327664f99215a69cb326682742dc3 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 27 Nov 2015 10:14:42 -0500 Subject: [PATCH] remote.c: Add missing cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes in C++: /home/emaisin/src/binutils-gdb/gdb/remote.c: In function ‘void start_thread(gdb_xml_parser*, const gdb_xml_element*, void*, VEC_gdb_xml_value_s*)’: /home/emaisin/src/binutils-gdb/gdb/remote.c:2975:59: error: invalid conversion from ‘void*’ to ‘const char*’ [-fpermissive] item.name = attr != NULL ? (char *) xstrdup (attr->value) : NULL; ^ In file included from /home/emaisin/src/binutils-gdb/gdb/common/common-defs.h:64:0, from /home/emaisin/src/binutils-gdb/gdb/defs.h:28, from /home/emaisin/src/binutils-gdb/gdb/remote.c:22: /home/emaisin/src/binutils-gdb/gdb/../include/libiberty.h:323:14: error: initializing argument 1 of ‘char* xstrdup(const char*)’ [-fpermissive] extern char *xstrdup (const char *) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL; ^ make[2]: *** [remote.o] Error 1 gdb/ChangeLog: * remote.c (start_thread): Add cast. --- gdb/ChangeLog | 4 ++++ gdb/remote.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 54642e1..fd84223 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2015-11-27 Simon Marchi + + * remote.c (start_thread): Add cast. + 2015-11-27 Yao Qi * nat/aarch64-linux-hw-point.c (aarch64_dr_state_remove_one_point): diff --git a/gdb/remote.c b/gdb/remote.c index a80e548..90be8b6 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2972,7 +2972,7 @@ start_thread (struct gdb_xml_parser *parser, item.core = -1; attr = xml_find_attribute (attributes, "name"); - item.name = attr != NULL ? xstrdup (attr->value) : NULL; + item.name = attr != NULL ? xstrdup ((const char *) attr->value) : NULL; item.extra = 0;