From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18306 invoked by alias); 17 Apr 2003 20:20:26 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 18299 invoked from network); 17 Apr 2003 20:20:25 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 17 Apr 2003 20:20:25 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 196Frp-0002Mf-00; Thu, 17 Apr 2003 15:20:21 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 196Frc-0001FK-00; Thu, 17 Apr 2003 16:20:08 -0400 Date: Thu, 17 Apr 2003 20:20:00 -0000 From: Daniel Jacobowitz To: Al Niessner Cc: gdb@sources.redhat.com Subject: Re: Setting watchpoints Message-ID: <20030417202008.GB2867@nevyn.them.org> Mail-Followup-To: Al Niessner , gdb@sources.redhat.com References: <1050610199.24880.20.camel@morte.jpl.nasa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1050610199.24880.20.camel@morte.jpl.nasa.gov> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-04/txt/msg00202.txt.bz2 On Thu, Apr 17, 2003 at 01:09:59PM -0700, Al Niessner wrote: > > Platform information: > OS: Linux > Kernel: 2.4.19 > gcc/g++: 3.2.2 > gdb: 5.3 > threads: 1 -- single threaded application > > > How do I set a watch point so that the debugger halts when memory at a > specific address is changed? There is no easy to define variable that I > can latch onto, but I do know its address. When I set a watch point to > this address -- 'watch 0x8559ff4' or 'watch *0x8559ff4' -- gdb just > sails by this memory being changed. If I set a conditional break point > just prior to the segmentation fault I can see the change and so can gdb > it just does not sense it with the watch. So, what am I doing wrong and > how do I get gdb to monitor a memory location and halt when it changes? > I have already searched the web (google) and did not find any solutions > there. Does "watch *(int *) 0x8559ff4" work? How big is the area you're watching? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer