From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12626 invoked by alias); 18 Sep 2005 01:20:54 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12611 invoked by uid 22791); 18 Sep 2005 01:20:50 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 18 Sep 2005 01:20:50 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1EGnrK-0008OR-26; Sat, 17 Sep 2005 21:20:46 -0400 Date: Sun, 18 Sep 2005 01:20:00 -0000 From: Daniel Jacobowitz To: Manoj Iyer Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] GDB patches for hw watchpoints Message-ID: <20050918012046.GP8777@nevyn.them.org> Mail-Followup-To: Manoj Iyer , gdb-patches@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-09/txt/msg00140.txt.bz2 On Wed, Aug 17, 2005 at 12:27:46PM -0500, Manoj Iyer wrote: > > I am submitting this patch on behalf of Ben Elliston , > this patch implements hardware watchpoints on PPC platform. Please review > and comment, so I can commit. > > 2005-05-04 Ben Elliston > > * config/powerpc/nm-linux.h > (HAVE_NONSTEPPABLE_WATCHPOINT): Define. > (TARGET_REGION_OK_FOR_HW_WATCHPOINT): Likewise. > (TARGET_CAN_USE_HARDWARE_WATCHPOINT): Likewise. > (STOPPED_BY_WATCHPOINT): Likewise. > (target_insert_watchpoint): Likewise. > (target_remove_watchpoint): Likewise. > (ppc_linux_insert_watchpoint): Declare. > (ppc_linux_remove_watchpoint): Likewise. > * ppc-linux-nat.c (PTRACE_GET_DEBUGREG): Define, if not already. > (PTRACE_SET_DEBUGREG): Likewise. > (PTRACE_GETSINGOINFO): Likewise. > (ppc_linux_insert_watchpoint): New. > (ppc_linux_remove_watchpoint): Likewise. > (ppc_linux_stopped_by_watchpoint): Likewise. > (ppc_linux_check_watch_resources): Likewise. Mark raised a valid concern about the use of the NM file for this; the problem has now been fixed, so you can do this without touching nm-linux.h. Eli asked a valid question about how the entire process works. Also, I had trouble believing that this interface was sufficiently portable among the many PowerPC variants (which have at least two different debug register schemes), so I went and checked. Support for these ptrace operations is not in the kernel.org kernel. Where is it, and how's it supposed to work? > + errno = 0; > + ptrace (PTRACE_GETSIGINFO, tid, (PTRACE_TYPE_ARG3) 0, &siginfo); > + > + if (errno != 0 || siginfo.si_signo != SIGTRAP || > + (siginfo.si_code & 0xffff) != 0x0004) > + return 0; Hmm, if you're using siginfos for this, then at least some PPCs ought to be able to tell you where the fault occured. > +int > +ppc_linux_check_watch_resources (int type, int cnt, int ot) > +{ > + /* PPC has one DABR (hardware watchpoint) register. */ > + return (cnt <= 1); > +} Some have none. I don't know what other variations there may be. -- Daniel Jacobowitz CodeSourcery, LLC