This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] no frame needed when computing address of subprogram
- From: Daniel Jacobowitz <drow at false dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 2 Jan 2008 07:57:18 -0500
- Subject: Re: [RFA] no frame needed when computing address of subprogram
- References: <20080101134652.GB3770@adacore.com>
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