From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8873 invoked by alias); 9 Aug 2004 17:48:41 -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 8864 invoked from network); 9 Aug 2004 17:48:39 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.77.109) by sourceware.org with SMTP; 9 Aug 2004 17:48:39 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i79HmYZt000683; Mon, 9 Aug 2004 19:48:34 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i79HmXmT038570; Mon, 9 Aug 2004 19:48:33 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i79HmXOS038567; Mon, 9 Aug 2004 19:48:33 +0200 (CEST) Date: Mon, 09 Aug 2004 17:48:00 -0000 Message-Id: <200408091748.i79HmXOS038567@elgar.kettenis.dyndns.org> From: Mark Kettenis To: rmh@debian.org CC: neroden@twcny.rr.com, gdb-patches@sources.redhat.com, glibc-bsd-hackers@nongnu.org In-reply-to: <20040809162831.GD2417@khazad.dyndns.org> (message from Robert Millan on Mon, 9 Aug 2004 18:28:31 +0200) Subject: Re: [PATCH] GNU/k*BSD fixes [w/ChangeLog] References: <20040807022015.GA11745@khazad.dyndns.org> <200408090659.i796xKMs000507@elgar.kettenis.dyndns.org> <20040809162831.GD2417@khazad.dyndns.org> X-SW-Source: 2004-08/txt/msg00322.txt.bz2 Date: Mon, 9 Aug 2004 18:28:31 +0200 From: Robert Millan 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) Indeed defenitely exists on all FreeBSD systems, and is the official way to get the defined we're talking about here. 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? Not really. I'm sort of bending the rules in i386bsd-nat.c by checking the version numbers. By adding more to it, I run the risk that people start noticing it ;-). Anyway, this code is not really adding any functionality. It's just a bunch of consistency checks, that you can perfectly well do without. > 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. I'm talking about dropping support for pre-FreeBSD-BSD here, which actually isn't supported. I'll remove that stuff and you can forget about the #ifdefs. > 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. IIRC the Hurd once had such a compatibility library. Anyway ... 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? It only needs the definition of `struct nlist'. If something else provides that (presumably your has been hacked to do that) everything is fine. I'll add the #ifdef HAVE_NLIST_H. It can't hurt. Mark