From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17253 invoked by alias); 6 Mar 2008 19:17:25 -0000 Received: (qmail 17242 invoked by uid 22791); 6 Mar 2008 19:17:24 -0000 X-Spam-Check-By: sourceware.org Received: from nwd2mail11.analog.com (HELO nwd2mail11.analog.com) (137.71.25.57) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 06 Mar 2008 19:16:55 +0000 X-IronPort-AV: E=Sophos;i="4.25,457,1199682000"; d="scan'208";a="49710208" Received: from nwd2mhb2.analog.com ([137.71.6.12]) by nwd2mail11.analog.com with ESMTP; 06 Mar 2008 14:16:53 -0500 Received: from nwd2exm4.ad.analog.com (nwd2exm4.ad.analog.com [10.64.53.123]) by nwd2mhb2.analog.com (8.9.3 (PHNE_28810+JAGae91741)/8.9.3) with ESMTP id OAA20202; Thu, 6 Mar 2008 14:16:50 -0500 (EST) Received: from chinexm1.ad.analog.com ([10.99.27.42]) by nwd2exm4.ad.analog.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 6 Mar 2008 14:16:49 -0500 Received: from [10.90.101.217] ([10.90.101.217]) by chinexm1.ad.analog.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 7 Mar 2008 03:16:47 +0800 Message-ID: <47D04329.7080600@analog.com> Date: Thu, 06 Mar 2008 20:24:00 -0000 From: Jie Zhang User-Agent: Mozilla-Thunderbird 2.0.0.9 (X11/20080110) MIME-Version: 1.0 To: Guillaume MENANT CC: gdb@sourceware.org Subject: Re: Write watchpoints References: <15867705.post@talk.nabble.com> In-Reply-To: <15867705.post@talk.nabble.com> 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/msg00078.txt.bz2 Guillaume MENANT wrote: > I'm trying to implement watchpoints management in my software but it doesn't > works. For a write watchpoint at 0x800000A4, GDB sets it (Z2) and then the > watchpoint triggers on my board (just before executing the asm instruction > which modifies the 0x800000A4 address), so I send back the answer > T05watch800000A4 to GDB before effectively writing to the 0x800000A4 > address. Then GDB reads the system registers (G), reads at the 0x800000A4 > address, unsets the watchpoint, reads at the 0x800000A4 address, re-sets the > watchpoint (at the same address) and make a continue. Then the watchpoint > triggers again immediately because the instruction modifying the 0x800000A4 > address has not been executed before. > > What is the problem with this GDB flow ? What can I do ? > It seems that gdb expects the address of the next instruction to watchpoint when watchpoint is triggered. Blackfin is similar to your target: the watchpoint is triggered just when the address appears on the address bus and before the write happens. We just do a single step and send the address of the next instruction of the one which triggers the watchpoint to gdb. Jie