From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4834 invoked by alias); 20 Mar 2008 18:23:24 -0000 Received: (qmail 4763 invoked by uid 22791); 20 Mar 2008 18:23:23 -0000 X-Spam-Check-By: sourceware.org Received: from smtp1.dnsmadeeasy.com (HELO smtp1.dnsmadeeasy.com) (205.234.170.144) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 20 Mar 2008 18:22:59 +0000 Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1]) by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 4D61D315FF6; Thu, 20 Mar 2008 18:23:10 +0000 (UTC) X-Authenticated-Name: js.dnsmadeeasy X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com Received: from avtrex.com (unknown [67.116.42.147]) by smtp1.dnsmadeeasy.com (Postfix) with ESMTP; Thu, 20 Mar 2008 18:23:10 +0000 (UTC) Received: from dl2.hq2.avtrex.com ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 20 Mar 2008 11:22:56 -0700 Message-ID: <47E2AB7F.8000607@avtrex.com> Date: Thu, 20 Mar 2008 20:57:00 -0000 From: David Daney User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: Paul Koning Cc: gdb@sourceware.org Subject: Re: Hardware watchpoint support for MIPS? References: <47E28F5F.3010209@avtrex.com> <18402.40355.699459.116801@gargle.gargle.HOWL> <47E2A05D.8040104@avtrex.com> <18402.42671.693454.471284@gargle.gargle.HOWL> In-Reply-To: <18402.42671.693454.471284@gargle.gargle.HOWL> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2008-03/txt/msg00185.txt.bz2 Paul Koning wrote: >>>>>> "David" == David Daney writes: > > David> Paul Koning wrote: > >>>>>>> "David" == David Daney writes: > >> > David> GDB has had support for i386 debug registers on linux for > David> quite some time now. > >> > David> I was wondering if anyone has worked on similar support for > David> the hardware debug support available in some MIPS processors? > >> Yes, I have it on MIPS/sb1. > >> > > David> Great! > > David> Could you be more specific? Like where are the kernel patches > David> to expose the debugs registers to ptrace and the gdb patches > David> to take advantage of them? > > As Daniel pointed out, the kernel and ptrace changes are really the > issue here. > > We modified a NetBSD 1.6.2 kernel, adding watchpoint primitives to its > gdb stub (for kernel debug) and also to its ptrace. The ptrace stuff > was a bit hairy because you have to context switch that state. > > I don't think I had to change gdb at all, except perhaps for setting > the #define symbols to turn the feature on and describe its behavior > correctly with respect to single stepping. > > Well, there was a bug at least in the earlier 6.x gdb releases where > the code to sort out breakpoints and watchpoints would come up with > the wrong answer if you hit a watchpoint while a breakpoint was also > active (even at some entirely different address). > > And yes, the notion of watchpoint is in the MIPS architecture but the > specifics vary among implementations. I have seen several, and they > are close enough that a single gdb talking the same remote protocol > works with all of them, but the target end does change somewhat from > one MIPS flavor to the next. > OK, thanks. I mistakenly thought that you already had it working on mips[el]-linux and I might just be able to drop it in (It's OK to dream isn't it?). David Daney