This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] no frame needed when computing address of subprogram


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]