From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 948 invoked by alias); 16 Oct 2009 23:22:50 -0000 Received: (qmail 824 invoked by uid 22791); 16 Oct 2009 23:22:49 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Oct 2009 23:22:43 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id CA9102BABFB; Fri, 16 Oct 2009 19:22:41 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ftaCiiydWNbb; Fri, 16 Oct 2009 19:22:41 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 73E002BABF6; Fri, 16 Oct 2009 19:22:41 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 44219F591F; Fri, 16 Oct 2009 16:22:38 -0700 (PDT) Date: Fri, 16 Oct 2009 23:22:00 -0000 From: Joel Brobecker To: Steve Kargl , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix building gdb-7.0 on x86_64-*-freebsd Message-ID: <20091016232238.GV5288@adacore.com> References: <20091012215518.GA45050@troutmask.apl.washington.edu> <20091014050550.GV5272@adacore.com> <1530bbfee75f68f9c32262460f1ec7f9.squirrel@webmail.xs4all.nl> <20091015021317.GD5288@adacore.com> <20091015230013.GA49371@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091015230013.GA49371@troutmask.apl.washington.edu> User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00376.txt.bz2 [gdb-patches added back] I sent a private note to Mark asking whether he wanted to review this patch and he approved it. The version number was further refined based on feedback from the FreeBSD developers, I believe. So I checked in this change for Mark (who is currently traveling). What I am not sure I understand completely is whether this patch is required for gdb-7.x or not. On the one hand, you say it should compile fine on FreeBSD 8.0 (which is coming up for release, hopefully soon). But then you say that the fields has been removed from 8.0 and mainline, and so it's needed. I wonder if it was just a typo meaning ix86-*-freebsd instead of x86_64-*-freebsd. If this is the case, then the patch is needed for gdb-7.1 to build on FreeBSD 8.x and later. On Thu, Oct 15, 2009 at 04:00:13PM -0700, Steve Kargl wrote: > On Wed, Oct 14, 2009 at 07:13:17PM -0700, Joel Brobecker wrote: > > > I think this diff is perfectly fine. There is no reason to punish everybody > > > with a configure check that only makes sense on FreeBSD. > > > A comment would be fine though. > > > > Makes sense. And I can commit the patch for you. Steve, can you send > > an updated patch on the gdb-patches list, with the correct version number > > as well as a small comment explaining why this is needed? I'll then > > commit the patch using the "tiny change" rule. > > > > I've attached the updated patch. gdb-7.x should compile > out-of-the-box on FreeBSD 8.0 (when released) and mainline > x86_64-*-freebsd. The reason the patch is needed is that > the members pcb_{fs,ds,es,gs} of the pcb struct in > sys/amd64/include/pcb.h have been removed in mainline and > for the upcoming FreeBSD 8.0 release. > > 2008-10-15 Steven G. Kargl > > * amd64fbsd-nat.c (amd64fbsd_supply_pcb): Conditionally compile in > support for pcb->pcb_{fs,ds,es,gs} on FreeBSD older than 8.0. > > -- > Steve > --- amd64fbsd-nat.c.orig 2009-10-12 14:38:56.000000000 -0700 > +++ amd64fbsd-nat.c 2009-10-12 14:40:13.000000000 -0700 > @@ -95,6 +95,7 @@ > > #include > #include > +#include > > #include "bsd-kvm.h" > > @@ -123,10 +124,12 @@ > regcache_raw_supply (regcache, 13, &pcb->pcb_r13); > regcache_raw_supply (regcache, 14, &pcb->pcb_r14); > regcache_raw_supply (regcache, 15, &pcb->pcb_r15); > +#if (__FreeBSD_version < 800075) > regcache_raw_supply (regcache, AMD64_DS_REGNUM, &pcb->pcb_ds); > regcache_raw_supply (regcache, AMD64_ES_REGNUM, &pcb->pcb_es); > regcache_raw_supply (regcache, AMD64_FS_REGNUM, &pcb->pcb_fs); > regcache_raw_supply (regcache, AMD64_GS_REGNUM, &pcb->pcb_gs); > +#endif > > return 1; > } -- Joel