From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17215 invoked by alias); 19 Oct 2006 20:12:27 -0000 Received: (qmail 17204 invoked by uid 22791); 19 Oct 2006 20:12:26 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 19 Oct 2006 20:12:17 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GaeFS-0008QK-P4; Thu, 19 Oct 2006 16:12:14 -0400 Date: Thu, 19 Oct 2006 20:12:00 -0000 From: Daniel Jacobowitz To: Erik Leunissen Cc: gdb@sourceware.org Subject: Re: breakpoint for accessing memory location Message-ID: <20061019201214.GA32332@nevyn.them.org> Mail-Followup-To: Erik Leunissen , gdb@sourceware.org References: <4537DBC6.1030807@hccnet.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4537DBC6.1030807@hccnet.nl> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00144.txt.bz2 On Thu, Oct 19, 2006 at 10:10:46PM +0200, Erik Leunissen wrote: > Hi, > > I've got a shared lib that I programmed to store some data on the heap > in order to retrieve them later. The main program which loads the shared > lib appears to overwrite that location in memory, before the next time I > want to use it (which is weird because the main program shouldn't have a > clue about this particular action of the shared lib). > > So, in order to find out which part of the main program is being nasty, > I want to set some kind of breakpoint that alerts me whenever that > memory location is being written to. > > Is that possible using gdb? > > > (P.S. In the manual, I found the gdb command [break *address], but from > its behaviour, I think it's meant to do something different from what I > want.) Take a look at "watchpoints" in the manual. They should be exactly what you need. -- Daniel Jacobowitz CodeSourcery