From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12195 invoked by alias); 7 Sep 2005 13:53:24 -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 12174 invoked by uid 22791); 7 Sep 2005 13:53:18 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 07 Sep 2005 13:53:18 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1ED0MW-0001F1-Ad; Wed, 07 Sep 2005 09:53:16 -0400 Date: Wed, 07 Sep 2005 13:53:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: Evaluating an expression in a given scope Message-ID: <20050907135316.GA4753@nevyn.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: <20050907131434.GB2963@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-09/txt/msg00053.txt.bz2 On Wed, Sep 07, 2005 at 05:45:20PM +0400, Vladimir Prus wrote: > Daniel Jacobowitz wrote: > > > On Wed, Sep 07, 2005 at 04:39:52PM +0400, Vladimir Prus wrote: > >> > >> Hello! > >> > >> Does gdb provides a clean way to evaluate an expression in a given scope > >> (file:line)? > > > > No, not really. File:line doesn't match unambiguously to scope, > > either, so it's not clear what the interface should look like... I > > think I'd use $pc instead. > > You mean that variable can some into scope in the middle of assembler code > for a source-language line? Say: > > int i = j, j = 10; > > ? Well, true! Though it's really a corner case No. Think about inlining, template expansion, macro definitions with line numbers (which gcc doesn't do today but could in the future). A line is not an unambiguous reference to GDB's notion of a "scope". -- Daniel Jacobowitz CodeSourcery, LLC