From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9839 invoked by alias); 20 Dec 2011 16:05:48 -0000 Received: (qmail 9829 invoked by uid 22791); 20 Dec 2011 16:05:47 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,TW_CN X-Spam-Check-By: sourceware.org Received: from mail-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Dec 2011 16:05:32 +0000 Received: by wgbds11 with SMTP id ds11so10542483wgb.12 for ; Tue, 20 Dec 2011 08:05:31 -0800 (PST) Received: by 10.227.207.82 with SMTP id fx18mr2621878wbb.19.1324397131513; Tue, 20 Dec 2011 08:05:31 -0800 (PST) Received: from scottsdale.localnet (bl21-170-26.dsl.telepac.pt. [2.82.170.26]) by mx.google.com with ESMTPS id u5sm2493102wbm.2.2011.12.20.08.05.29 (version=SSLv3 cipher=OTHER); Tue, 20 Dec 2011 08:05:30 -0800 (PST) From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix PR gdb/12953: No hardware watchpoints on FreeBSD amd64 Date: Tue, 20 Dec 2011 16:12:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-13-generic; KDE/4.7.2; x86_64; ; ) Cc: Mark Kettenis , valery.khromov@gmail.com References: <1323132864-14029-1-git-send-email-valery.khromov@gmail.com> <201112201503.pBKF390e027750@glazunov.sibelius.xs4all.nl> In-Reply-To: <201112201503.pBKF390e027750@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201112201605.28313.alves.ped@gmail.com> X-IsSubscribed: yes 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: 2011-12/txt/msg00680.txt.bz2 On Tuesday 20 December 2011 15:03:09, Mark Kettenis wrote: > > From: Valery Khromov > > Date: Tue, 6 Dec 2011 04:54:24 +0400 > > > > This patch provides hardware breakpoint/watchpoint support for > > FreeBSD/AMD64. Most of the code is borrowed from the i386 implementation. > > I fear that since the recent changes that Pedro made, the code needs > to be resycnhed with the i386 version :(. Can you do that? Yeah, sorry about that. I was actually planning on taking the hit myself and updating Valery's patch. Let me know if you'd like me to do it. > > While you're at it, here are a few comments. > > > gdb/ChangeLog: > > 2011-12-05 Valery Khromov > > > > PR gdb/12953 > > * Makefile.in (HFILES_NO_SRCDIR): Add amd64bsd-nat.h. > > * amd64bsd-nat.c: Add support for debug registers (adapted from > > i386bsd-nat.c). > > [HAVE_PT_GETDBREGS] (DBREG_DRX): Define if not already defined. > > [HAVE_PT_GETDBREGS] (amd64bsd_dr_set, amd64bsd_dr_set_control, > > amd64bsd_dr_set_addr, amd64bsd_dr_reset_addr, amd64bsd_dr_get_status): > > New functions. > > * amd64bsd-nat.h: New file (adapted from i386bsd-nat.h). > > * amd64fbsd-nat.c: Include "amd64bsd-nat.h", "i386-nat.h". > > [HAVE_PT_GETDBREGS] (_initialize_amd64fbsd_nat): Add hardware > > watchpoints initialization. > > * config/i386/fbsd64.mh (NATDEPFILES): Add i386-nat.o. > > > > --- a/gdb/amd64bsd-nat.c > > +++ b/gdb/amd64bsd-nat.c > > @@ -126,3 +126,80 @@ amd64bsd_target (void) > > t->to_store_registers = amd64bsd_store_inferior_registers; > > return t; > > } > > + > > + > > +/* Support for debug registers. */ > > + > > +#ifdef HAVE_PT_GETDBREGS > > + > > +/* Not all versions of FreeBSD/amd64 that support the debug registers > > + have this macro. */ > > +#ifndef DBREG_DRX > > +#define DBREG_DRX(d, x) ((&d->dr0)[x]) > > +#endif > > That bit can go. FreeBSD/amd64 has always had the DBREG_DRX macro, at > least ever since support for debug registers was added. > -- Pedro Alves