From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22413 invoked by alias); 9 Aug 2004 16:32:24 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22255 invoked from network); 9 Aug 2004 16:32:21 -0000 Received: from unknown (HELO khazad.dyndns.org) (80.24.13.86) by sourceware.org with SMTP; 9 Aug 2004 16:32:21 -0000 Received: from aragorn ([192.168.0.1] helo=khazad.dyndns.org) by khazad.dyndns.org with esmtp (Exim 3.36 #1 (Debian)) id 1BuD7k-000072-00; Mon, 09 Aug 2004 18:35:48 +0200 Received: from rmh by khazad.dyndns.org with local (Exim 4.34) id 1BuD0h-0000in-UI; Mon, 09 Aug 2004 18:28:31 +0200 Date: Mon, 09 Aug 2004 16:32:00 -0000 From: Robert Millan To: Mark Kettenis , Nathanael Nerode Cc: gdb-patches@sources.redhat.com, glibc-bsd-hackers@nongnu.org Subject: Re: [PATCH] GNU/k*BSD fixes [w/ChangeLog] Message-ID: <20040809162831.GD2417@khazad.dyndns.org> References: <20040807022015.GA11745@khazad.dyndns.org> <200408090659.i796xKMs000507@elgar.kettenis.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200408090659.i796xKMs000507@elgar.kettenis.dyndns.org> Organisation: free as in freedom User-Agent: Mutt/1.5.6+20040722i X-SW-Source: 2004-08/txt/msg00314.txt.bz2 [ Nathanael, your email server at rr.com is rejecting my mail due to blacklisting. You will probably only read this message through gdb-patches. I have tried neroden-guest@alioth.debian.org too, with no luck. Please tell me an address where I can reach you. ] On Sun, Aug 08, 2004 at 11:59:32PM -0400, Nathanael Nerode wrote: > +#if defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) > +# define __FreeBSD_kernel__ __FreeBSD__ > +#endif > +#ifdef __FreeBSD_kernel__ > +# include > +# ifndef __FreeBSD_kernel_version > +# define __FreeBSD_kernel_version __FreeBSD_version > +# endif > +#endif > > ...and I wondered if it is absolutely guaranteed that will > exist on all FreeBSD and FreeBSD-kernel systems of any possible vintage > supported by GDB. Cause otherwise this could break the build on other > systems. Asides GNU/kFreeBSD I'm not aware of other non-FreeBSD systems using kernel of FreeBSD. Wrt different versions of FreeBSD, I can't be completely sure some arcane version of FreeBSD didn't have osreldate.h. I propose the following alternative, which also looks cleaner: #ifdef HAVE_SYS_PARAM_H #include /* __FreeBSD_{kernel_,}version */ #endif #if defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) # define __FreeBSD_kernel__ __FreeBSD__ # define __FreeBSD_kernel_version __FreeBSD_version #endif (note: osreldate.h and sys/param.h are equivalent for this purpose) On Mon, Aug 09, 2004 at 08:59:20AM +0200, Mark Kettenis wrote: > > Yuck, the #ifdef mess in i386bsd-nat.c gets ugly. I think it should > be simplified. Does the proposed alternative above address this concern? > You're probably changing it to avoid the warning about > the offsets in `struct sigcontext'. If I just drop the support for > ancient BSD (which isn't used anyway) we can avoid that. You won't > get the extra check on GNU/kFreeBSD then, but as long as enough people > use GDB on normal FreeBSD/i386, this doesn't really matter. The oldest version of kFreeBSD we ever supported is 4.6, so compatibility with 3.x is not an issue for us. If you want to drop support for 3.x, that is fine with me. > Considering the changes to bsd-kvm.c. We shouldn't include config.h > directly. In GDB "defs.h" does that for us. Ok. > I assume that GNU/k*BSD > still has libkvm. Why doesn't it have ? If not, then where > does it get its `struct nlist' from? We have libkvm, but not nlist() which is not part of Glibc. I'm considering adding nlist() and other functions in a compatibility library (e.g. libbsd), though. But I was surprised that disabling the '#include ' didn't cause the build process to fail on missing declarations. Does bsd-kvm.c really work without nlist, or am I missing something? -- Robert Millan (Debra and Ian) (Gnu's Not (UNiplexed Information and Computing System))/\ (kernel of *(Berkeley Software Distribution))