From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25496 invoked by alias); 17 Apr 2003 20:28:16 -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 25466 invoked from network); 17 Apr 2003 20:28:15 -0000 Received: from unknown (HELO morte.jpl.nasa.gov) (137.78.15.44) by sources.redhat.com with SMTP; 17 Apr 2003 20:28:15 -0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by morte.jpl.nasa.gov (Postfix) with ESMTP id 82A7C404CB0 for ; Thu, 17 Apr 2003 13:28:15 -0700 (PDT) Subject: Re: Setting watchpoints From: Al Niessner To: gdb@sources.redhat.com In-Reply-To: <20030417202008.GB2867@nevyn.them.org> References: <1050610199.24880.20.camel@morte.jpl.nasa.gov> <20030417202008.GB2867@nevyn.them.org> Content-Type: text/plain Organization: Jet Propulsion Laboratory Message-Id: <1050611295.24877.28.camel@morte.jpl.nasa.gov> Mime-Version: 1.0 Date: Thu, 17 Apr 2003 20:28:00 -0000 Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00203.txt.bz2 I am watching a character pointer. 'watch *0x8559ff4' does not work because that is the value of the pointer in the structure. Watching the char** instead of char* works great though. To get the char** I did a print &(symbol->name). So, gdb works as expected and I make mistakes -- as expected?? Thanks for the help though. On Thu, 2003-04-17 at 13:20, Daniel Jacobowitz wrote: > 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? -- Al Niessner Jet Propulsion Laboratory All opinions stated above are mine and do not necessarily reflect those of JPL or NASA. ---- | dS | >= 0 ----