From patchwork Fri May 15 15:09:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 6741 Received: (qmail 43845 invoked by alias); 15 May 2015 15:09:32 -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 43826 invoked by uid 89); 15 May 2015 15:09:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=no 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, 15 May 2015 15:09:29 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 6853F8F2EC; Fri, 15 May 2015 15:09:28 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4FF9Qrk029256; Fri, 15 May 2015 11:09:27 -0400 Message-ID: <55560C26.4000004@redhat.com> Date: Fri, 15 May 2015 16:09:26 +0100 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: asmwarrior , GDB Patches Subject: Re: [all pushed] Re: [PATCH 00/36] Support building GDB as a C++ program References: <1423524046-20605-1-git-send-email-palves@redhat.com> <54F0B52F.1050909@redhat.com> <54FB20E2.2040403@redhat.com> <54FB3C58.6050702@redhat.com> <550660C5.2060009@gmail.com> <5506661C.1040103@gmail.com> <5506C18C.9080408@redhat.com> <5555AC9F.7020206@gmail.com> <5555AF38.9000100@gmail.com> In-Reply-To: <5555AF38.9000100@gmail.com> On 05/15/2015 09:32 AM, asmwarrior wrote: > There is another one build error: > > In file included from ../../../binutils-gdb/gdb/gdbserver/server.h:61:0, > from ../../../binutils-gdb/gdb/gdbserver/server.c:19: > ../../../binutils-gdb/gdb/gdbserver/target.h:442:50: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' > (*the_target->handle_new_gdb_connection) () : 0) > ^ > > The second operand is a function call which return void, so I have a simply changed the third operand like below: (maybe, we just need a simple if statement instead the conditional operator) Yes, we do that already for a few other target methods. Below's what I pushed. I apologize if we've been through this before, but, do you have a copyright assignment in place? I couldn't seem to find it on record. If you do, it would make sense to get you commit access so you could push changes yourself. Let me know and we'll set that up. Thanks again! ---------- From: Pedro Alves Date: 2015-05-15 16:00:42 +0100 More C++ build fixing Fixes: In file included from ../../../binutils-gdb/gdb/gdbserver/server.h:61:0, from ../../../binutils-gdb/gdb/gdbserver/server.c:19: ../../../binutils-gdb/gdb/gdbserver/target.h:442:50: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' (*the_target->handle_new_gdb_connection) () : 0) ^ Reported by Yuanhui Zhang. gdb/gdbserver/ChangeLog: 2015-05-15 Pedro Alves * target.h (target_handle_new_gdb_connection): Rewrite using if wrapped in do/while. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/target.h | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 1fc24be..0f30c66 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2015-05-15 Pedro Alves + + * target.h (target_handle_new_gdb_connection): Rewrite using if + wrapped in do/while. + 2015-05-14 Joel Brobecker * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check. diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h index 8d23383..e9c6be0 100644 --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -437,9 +437,12 @@ int kill_inferior (int); (the_target->supports_vfork_events ? \ (*the_target->supports_vfork_events) () : 0) -#define target_handle_new_gdb_connection() \ - (the_target->handle_new_gdb_connection ? \ - (*the_target->handle_new_gdb_connection) () : 0) +#define target_handle_new_gdb_connection() \ + do \ + { \ + if (the_target->handle_new_gdb_connection != NULL) \ + (*the_target->handle_new_gdb_connection) (); \ + } while (0) #define detach_inferior(pid) \ (*the_target->detach) (pid)