From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15316 invoked by alias); 30 Jul 2002 17:20:57 -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 15223 invoked from network); 30 Jul 2002 17:20:30 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 30 Jul 2002 17:20:30 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id A74EB5EA11; Tue, 30 Jul 2002 12:20:28 -0500 (EST) To: Arjan van Dijk Cc: gdb@sources.redhat.com Subject: Re: How to set a watch to a point in the source? References: From: Jim Blandy Date: Tue, 30 Jul 2002 10:20:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-07/txt/msg00307.txt.bz2 Arjan van Dijk writes: > Can someone tell me please if and how I can instruct gdb to do the following? > I want to add a certain variable to the display list by specifying its > position in the source code. GDB doesn't keep any information about the location of a variable's declaration --- that I can find, anyway. I think you're out of luck. What GDB can do, however, is find the definition in scope at a particular source line. If you could parse out the variable name from the source, and then look up that name in the context of that source line, then you could get the right variable. I don't know of any existing interface for doing that; so you'd need to hack on GDB either way. (Am I missing some MI capability or something? I'd love to be wrong.)