From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9802 invoked by alias); 17 Oct 2009 00:17:01 -0000 Received: (qmail 9791 invoked by uid 22791); 17 Oct 2009 00:17:00 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.208.78.105) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 17 Oct 2009 00:16:56 +0000 Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.3/8.14.3) with ESMTP id n9H0GV4m060152; Fri, 16 Oct 2009 17:16:31 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.3/8.14.3/Submit) id n9H0GVwH060151; Fri, 16 Oct 2009 17:16:31 -0700 (PDT) (envelope-from sgk) Date: Sat, 17 Oct 2009 00:17:00 -0000 From: Steve Kargl To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix building gdb-7.0 on x86_64-*-freebsd Message-ID: <20091017001631.GA60006@troutmask.apl.washington.edu> 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> <20091016232238.GV5288@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091016232238.GV5288@adacore.com> User-Agent: Mutt/1.4.2.3i 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/msg00377.txt.bz2 On Fri, Oct 16, 2009 at 04:22:38PM -0700, Joel Brobecker wrote: > [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. The patch is required for x86_64-*-freebsd. I'm deleting a bunch of context to get to the relevant portion of the diff. > > +#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 The above number 800075 means that any version of FreeBSD with __FreeBSD_version less than 800075 will have a struct pcb with the pcb_{fged} members. Any version with __FreeBSD_version greater than or equal to 800075 will have these structure members removed. The '8' in 800075 signifies the FreeBSD 8-branch. The '75' signifies that 75 changes have occurred on the FreeBSD 8-branch that might need special handling. The removal of the struct members occurred on 2009-04-01 while the version number was bumped to 800075 on 2009-04-06. It's the closest version number that will work in the '#if (...)' that will allow the gdb-7.x branch to build on all versions of FreeBSD on the amd64 architecture including the 8.0-Release Candidates (ie., the beta releases). -- Steve