From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3974 invoked by alias); 30 Jul 2002 09:04:00 -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 3967 invoked from network); 30 Jul 2002 09:03:59 -0000 Received: from unknown (HELO max.phys.uu.nl) (131.211.32.73) by sources.redhat.com with SMTP; 30 Jul 2002 09:03:59 -0000 Received: from [131.211.32.140] (hst32140.phys.uu.nl [131.211.32.140]) by max.phys.uu.nl (8.9.3/8.9.3/hjm) with ESMTP id LAA28955 for ; Tue, 30 Jul 2002 11:03:58 +0200 (MET DST) X-Sender: vndijk@mail.phys.uu.nl Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Tue, 30 Jul 2002 02:04:00 -0000 To: gdb@sources.redhat.com From: Arjan van Dijk Subject: How to set a watch to a point in the source? X-SW-Source: 2002-07/txt/msg00306.txt.bz2 Hi, 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. The option to specify the source-file name is too coarse, since there are many routines in one file and they all have variables with similar names (e.g. a counter named "i"). The option to give the name of the routine would do the job, but then I would have to find out to which routine the variable belongs. With nested subroutines this is a terrible job. For setting breakpoints I found out that one can specify either a subroutine name or a linenumber. For setting watches I could not find an equivalent for the latter. Background: I am working on a set of macro-commands for the editor NEdit to collaborate with gdb via a shell-link. With a keystroke in NEdit I can select the variable under the cursor and send the filename, linenumber and column number to gdb. Making a macro that determines to which subroutine that variable belongs is no fun. Thanks for any suggestion, Arjan Arjan van Dijk Institute for Marine and Atmospheric Research Utrecht Faculty of Physics and Astronomy Utrecht University Princetonplein 5 NL - 3584 CC Utrecht The Netherlands phone: +31 30 2532815 fax: +31 30 2543163 e-mail: mailto:A.vanDijk@phys.uu.nl homepage: http://www.phys.uu.nl/~vndijk