From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125285 invoked by alias); 19 Apr 2016 21:40:34 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 125267 invoked by uid 89); 19 Apr 2016 21:40:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*UA:FreeBSD, H*u:FreeBSD, Hx-languages-length:1547, HContent-Transfer-Encoding:7Bit X-HELO: bigwig.baldwin.cx Received: from bigwig.baldwin.cx (HELO bigwig.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 19 Apr 2016 21:40:31 +0000 Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 27773B982; Tue, 19 Apr 2016 17:40:29 -0400 (EDT) From: John Baldwin To: Pedro Alves Cc: gdb@sourceware.org Subject: Re: C++ conversion status update Date: Tue, 19 Apr 2016 21:40:00 -0000 Message-ID: <2275223.J41au61s2T@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <571696D1.807@redhat.com> References: <565460FB.6070103@redhat.com> <4587615.ZrrbCebxpz@ralph.baldwin.cx> <571696D1.807@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00031.txt.bz2 On Tuesday, April 19, 2016 09:36:33 PM Pedro Alves wrote: > On 04/19/2016 07:22 PM, John Baldwin wrote: > > Thanks, I was able to test it and it works great on FreeBSD/amd64. > > Great, thanks for confirming. > > > The only remaining issue is that FreeBSD's stack_t defines ss_sp as char * > > instead of void *. Apparently 4.4BSD had this and the other BSD's fixed this > > long ago. When I first ran into this in January I fixed FreeBSD's trunk, so > > 11.0 will ship with a proper ss_sp of void *, but older releases will not. > > > > > The affected code is in setup_alternate_signal_stack() in gdb/main.c where > > ss_sp is assigned to the void * returned from xmalloc(). > > > > I was torn between just supporting C++ builds on FreeBSD 11 and later, or > > adding autoconf glue for just this part. However, given that it seems like > > the recent discussion is to deprecate C mode in the near future, it seems > > like I should do the latter. Do you have any better suggestions? > > > > C++ allows conversion to 'void *' without a cast. So I think > we just need to do: > > - ss.ss_sp = xmalloc (SIGSTKSZ); > + ss.ss_sp = (char *) xmalloc (SIGSTKSZ); > > and it'll work on both char * and void * hosts. I tried it > here on GNU/Linux, where ss_sp is void *, and it works. > > Would you like to send that as a patch (with a comment)? > > We can leave adding an autoconf check if some other host uses > a type different than void * and char *. Ok, I will include that in my current patchset. -- John Baldwin