From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7076 invoked by alias); 5 Sep 2017 11:19:00 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 7039 invoked by uid 89); 5 Sep 2017 11:18:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=HTo:D*gmx.com 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, 05 Sep 2017 11:18:53 +0000 Received: from John-Baldwins-MacBook-Pro-2.local (unknown [205.153.92.178]) by mail.baldwin.cx (Postfix) with ESMTPSA id 4363B10A87D; Tue, 5 Sep 2017 07:18:52 -0400 (EDT) Subject: Re: [binutils-gdb] Enable support for x86 debug registers on NetBSD. To: Kamil Rytarowski References: <20170905024337.88051.qmail@sourceware.org> <53223a37-4aee-76f1-4b5e-131f52cafab0@gmx.com> Cc: gdb@sourceware.org, coypu@sdf.org From: John Baldwin Message-ID: <7b23e1a8-c303-f9f8-3180-9af30a3fb25e@FreeBSD.org> Date: Tue, 05 Sep 2017 11:19:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <53223a37-4aee-76f1-4b5e-131f52cafab0@gmx.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00003.txt.bz2 On 9/5/17 4:48 AM, Kamil Rytarowski wrote: > On 05.09.2017 04:43, John Baldwin wrote: >> -/* Not all versions of FreeBSD/i386 that support the debug registers >> - have this macro. */ >> +/* Helper macro to access debug register X. FreeBSD/amd64 and modern >> + versions of FreeBSD/i386 provide this macro in system headers. Define >> + a local version for systems that do not provide it. */ >> #ifndef DBREG_DRX >> +#ifdef __NetBSD__ >> +#define DBREG_DRX(d, x) ((d)->dr[x]) >> +#else >> #define DBREG_DRX(d, x) ((&d->dr0)[x]) >> #endif >> +#endif >> >> static unsigned long >> x86bsd_dr_get (ptid_t ptid, int regnum) >> > > Do we support FreeBSD releases developed in year 2002? This macro has > point for such old systems as it keeps compat between old and new > structure layout. I have been trimming some older things from GDB master such as support for bsd-uthread and FreeBSD/alpha. However, keeping a fallback for this macro doesn't seem to be overly onerous or inhibiting maintenance currently. -- John Baldwin