From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7478 invoked by alias); 8 Aug 2008 11:56:30 -0000 Received: (qmail 7462 invoked by uid 22791); 8 Aug 2008 11:56:29 -0000 X-Spam-Check-By: sourceware.org Received: from ns1.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 08 Aug 2008 11:55:50 +0000 Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id F09A941A1F; Fri, 8 Aug 2008 13:55:47 +0200 (CEST) From: Andreas Schwab To: gdb@sourceware.org Cc: gdb Mailing List Subject: Re: How to watch for changes in a location of memory References: <20080808081041.GA32701@geppetto> <20080808091156.GA8935@geppetto> X-Yow: I want EARS! I want two ROUND BLACK EARS to make me feel warm 'n secure!! Date: Fri, 08 Aug 2008 12:48:00 -0000 In-Reply-To: <20080808091156.GA8935@geppetto> (Stefano Sabatini's message of "Fri, 8 Aug 2008 11:11:56 +0200") Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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-08/txt/msg00150.txt.bz2 Message-ID: <20080808124800.QlkErBQZGN5BaNwYLVfRIPtL2cH3EzrfgRb3NRuKl8I@z> Stefano Sabatini writes: > On date Friday 2008-08-08 10:37:50 +0200, Eran Ifrah wrote: >> You might want to try the 'watch' command which will causes gdb to >> break whenever the memory at a given addr has been modified >> >> Read here for more details: >> >> http://sources.redhat.com/gdb/current/onlinedocs/gdb_6.html#SEC34 > > Thank you for the good pointer, yes indeed it seems it does what I > want, which is basically: > watch &ctx->foo; This is equivalent to `watch ctx', since the address of ctx->foo can only change if ctx changes. Watching an address of something is generally not usefull. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."