From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128815 invoked by alias); 6 Jun 2017 17:49:02 -0000 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 Received: (qmail 127987 invoked by uid 89); 6 Jun 2017 17:48:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=Hx-languages-length:1139, Monday X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Jun 2017 17:48:56 +0000 Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 87A7F10AFA5; Tue, 6 Jun 2017 13:48:58 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Cc: coypu Subject: Re: [PATCH 1/1] Adjust fallback definition of DBREG_DRX for netbsd Date: Tue, 06 Jun 2017 17:49:00 -0000 Message-ID: <1693366.iCsyRdA5ot@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20170605120737.GA13182@SDF.ORG> References: <20170605120737.GA13182@SDF.ORG> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00154.txt.bz2 On Monday, June 05, 2017 12:07:37 PM coypu wrote: > This was originally inteded for freebsd~=5. freebsd has since moved > to the definition here, including the rename dr0->dr. > > netbsd now uses the same definitions as freebsd, including the use > of dr instead of dr0, but doesn't provide this macro. > --- > gdb/x86-bsd-nat.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/gdb/x86-bsd-nat.c b/gdb/x86-bsd-nat.c > index 2ff661c1..81bd0ad1 100644 > --- a/gdb/x86-bsd-nat.c > +++ b/gdb/x86-bsd-nat.c > @@ -51,10 +51,9 @@ x86bsd_mourn_inferior (struct target_ops *ops) > super_mourn_inferior (ops); > } > > -/* Not all versions of FreeBSD/i386 that support the debug registers > - have this macro. */ > +/* NetBSD doesn't provide a definition of this macro */ > #ifndef DBREG_DRX > -#define DBREG_DRX(d, x) ((&d->dr0)[x]) > +#define DBREG_DRX(d,x) ((d)->dr[(x)]) > #endif > > static unsigned long This is fine with me in that I don't think it's worth providing the alternate definition for really-old FreeBSD that used dr0. -- John Baldwin