From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11688 invoked by alias); 8 Aug 2008 08:13:32 -0000 Received: (qmail 11677 invoked by uid 22791); 8 Aug 2008 08:13:31 -0000 X-Spam-Check-By: sourceware.org Received: from relay-pt2.poste.it (HELO relay-pt2.poste.it) (62.241.5.253) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 08 Aug 2008 08:11:38 +0000 Received: from geppetto.reilabs.com (212.123.91.176) by relay-pt2.poste.it (7.3.122) (authenticated as stefano.sabatini-lala@poste.it) id 489B7EB700002371 for gdb@sources.redhat.com; Fri, 8 Aug 2008 10:11:34 +0200 Received: from stefano by geppetto.reilabs.com with local (Exim 4.67) (envelope-from ) id 1KRN3Z-0000yo-0L for gdb@sources.redhat.com; Fri, 08 Aug 2008 10:10:41 +0200 Date: Fri, 08 Aug 2008 08:13:00 -0000 From: Stefano Sabatini To: gdb Mailing List Subject: How to watch for changes in a location of memory Message-ID: <20080808081041.GA32701@geppetto> Mail-Followup-To: gdb Mailing List MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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/msg00145.txt.bz2 Hi all, I would like to check a variable in memory, I don't know in which function is modified, so I can't do a simple watch on a variable name. So I wonder if it is possible (gdb 6.8) to watch for a variable using the location rather than the var name. I'll try to express it more clearly: for example if I have a struct: FooCtx* ctx; containing a field foo, ctx is defined somewhere in the code, and may be accessed from different contexts, for example: trash->junk->ctx->foo; bar->ctx->foo; etc. How can I monitor for changes in ctx->foo simply specifying its location in memory (&ctx->foo), is it currently possible with gdb at all? Sorry if I overlooked something obvious. Thanks in advance, regards.