This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/1] Adjust fallback definition of DBREG_DRX for netbsd
- From: John Baldwin <jhb at freebsd dot org>
- To: gdb-patches at sourceware dot org
- Cc: coypu <coypu at sdf dot org>
- Date: Tue, 06 Jun 2017 10:43:24 -0700
- Subject: Re: [PATCH 1/1] Adjust fallback definition of DBREG_DRX for netbsd
- Authentication-results: sourceware.org; auth=none
- References: <20170605120737.GA13182@SDF.ORG>
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