From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23027 invoked by alias); 7 Sep 2005 12:44:02 -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 22969 invoked by uid 22791); 7 Sep 2005 12:43:56 -0000 Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 07 Sep 2005 12:43:56 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ECzFP-0005aZ-Al for gdb@sources.redhat.com; Wed, 07 Sep 2005 14:41:51 +0200 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Sep 2005 14:41:51 +0200 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Sep 2005 14:41:51 +0200 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Evaluating an expression in a given scope Date: Wed, 07 Sep 2005 12:44:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.8.2 X-SW-Source: 2005-09/txt/msg00046.txt.bz2 Hello! Does gdb provides a clean way to evaluate an expression in a given scope (file:line)? Here's the use case: while in file foo.cpp, line 200, user creates a watchpoint for expression 'g'. He then stops the GUI debugger and restarts it again. I want to store the watchpoint in some config file and recreate it again, but to do that I need a way to create watchpoint at specific scope. If I just use print g or display g righ away, this might print some other 'g', not the one visible on line 200 of foo.cpp. I think I can do this with: tbreak foo.cpp:100 jump foo.cpp:100 display g jump but I have concerns about this being reliable method. - Volodya