From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18998 invoked by alias); 19 Oct 2009 19:53:17 -0000 Received: (qmail 18985 invoked by uid 22791); 19 Oct 2009 19:53:16 -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; Mon, 19 Oct 2009 19:53:11 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 01FC62BACA9; Mon, 19 Oct 2009 15:53:10 -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 AlpaRJR6JSQY; Mon, 19 Oct 2009 15:53:09 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 99C0D2BACA5; Mon, 19 Oct 2009 15:53:09 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 6219FF5921; Mon, 19 Oct 2009 21:53:07 +0200 (CEST) Date: Mon, 19 Oct 2009 19:53:00 -0000 From: Joel Brobecker To: S?rgio Durigan J?nior Cc: gdb-patches@sourceware.org, Steve Kargl Subject: Re: [PATCH] Fix building gdb-7.0 on x86_64-*-freebsd Message-ID: <20091019195307.GC5282@adacore.com> References: <20091012215518.GA45050@troutmask.apl.washington.edu> <20091016232238.GV5288@adacore.com> <20091017001631.GA60006@troutmask.apl.washington.edu> <200910170205.58841.sergiodj@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: <200910170205.58841.sergiodj@linux.vnet.ibm.com> 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/msg00447.txt.bz2 --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1229 Hi Sergio, > Thank you for this patch. I believe you could add a comment explaining what > this number means (just like you did above). What do you think? > Just my two cents, as usual :-). I just applied the following patch (head only) 2009-10-19 Joel Brobecker * amd64fbsd-nat.c (amd64fbsd_supply_pcb): Add comment. Writing the comment made me think that we may have chosen the wrong version number, depending on the angle we look at things from: If we want to always be able to build, then we should have chosen version 74, since there are a few days where version 74 is missing the field and yet the GDB code still tries to access it for that versio number. However, if we're trying to have our code always use these fields whenver possible, then 75 is the right choice. Although we'll fail to build for any sources that's in between the moment the fields were removed and the moment the version was bumped to 75 (a time period of about a few days), we'll be able use these fields for the rest of version 74 of the sources. Based on the number of days this window is open, I would say that this situation is highly unlikely, and so we don't really need to worry about it. -- Joel --azLHFNyN32YCQGCU Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="comment.diff" Content-length: 1041 Index: amd64fbsd-nat.c =================================================================== RCS file: /cvs/src/src/gdb/amd64fbsd-nat.c,v retrieving revision 1.23 diff -u -p -r1.23 amd64fbsd-nat.c --- amd64fbsd-nat.c 16 Oct 2009 23:18:27 -0000 1.23 +++ amd64fbsd-nat.c 19 Oct 2009 19:47:18 -0000 @@ -125,6 +125,11 @@ amd64fbsd_supply_pcb (struct regcache *r regcache_raw_supply (regcache, 14, &pcb->pcb_r14); regcache_raw_supply (regcache, 15, &pcb->pcb_r15); #if (__FreeBSD_version < 800075) + /* struct pcb provides the pcb_ds/pcb_es/pcb_fs/pcb_gs fields only + up until __FreeBSD_version 800074: The removal of these fields + occurred on 2009-04-01 while the __FreeBSD_version number was + bumped to 800075 on 2009-04-06. So 800075 is the closest version + number where we should not try to access these fields. */ 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); --azLHFNyN32YCQGCU--