From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32749 invoked by alias); 2 Jan 2008 13:04:29 -0000 Received: (qmail 32727 invoked by uid 22791); 2 Jan 2008 13:04:28 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 02 Jan 2008 12:57:45 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 0F25F9811F; Wed, 2 Jan 2008 12:57:20 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id E3C7098118; Wed, 2 Jan 2008 12:57:19 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1JA39q-0008AP-TN; Wed, 02 Jan 2008 07:57:18 -0500 Date: Wed, 02 Jan 2008 13:04:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFA] no frame needed when computing address of subprogram Message-ID: <20080102125718.GB30490@caradoc.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sourceware.org References: <20080101134652.GB3770@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080101134652.GB3770@adacore.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00018.txt.bz2 On Tue, Jan 01, 2008 at 05:46:52AM -0800, Joel Brobecker wrote: > The problem is inside eval.c:evaluate_subexp_for_address, in the case > handling the OP_VAR_VALUE case. Unless we are in EVAL_AVOID_SIDE_EFFECT > mode, we end up doing: > > if (noside == EVAL_AVOID_SIDE_EFFECTS) > [...] > else > return > locate_var_value > (var, > block_innermost_frame (exp->elts[pc + 1].block)); > > In particular, we are trying to get the block_innermost_frame, > which doesn't exist in our case. The attached patch changes > that to first check that we need a frame to get the object > address, otherwise, we locate the value without a frame. Seems reasonable - but why does it have a block set? block_innermost_frame: 353 if (block == NULL) 354 return NULL; c-exp.y: if (symbol_read_needs_frame (sym)) { if (innermost_block == 0 || contained_in (block_found, innermost_block)) innermost_block = block_found; } -- Daniel Jacobowitz CodeSourcery