Re: MI: Another -var-update bug? [PATCH]

Vladimir Prus
2007-01-04T18:49:20Z

Nick Roberts wrote:

> Something like below?

This patch introduces this for me:

FAIL: gdb.mi/mi-var-cp.exp: update RX (3)

Do you get this failure to? If yes, can you please fix it?
If no, let me know and I'll investigate.

> /* FIXME: select_frame could fail */
> ! Â  Â  Â  if (fi)
> ! Â Â Â Â Â Â {
> ! Â Â Â Â Â Â  Â CORE_ADDR pc = get_frame_pc (fi);
> ! Â Â Â Â Â Â  Â if (pc < Â BLOCK_START (var->root->valid_block) ||
> ! Â Â Â Â Â Â  Â  Â  Â pc >= BLOCK_END (var->root->valid_block))
> ! Â Â Â Â Â Â  Â  Â within_scope = 0;
> ! Â Â Â Â Â Â  Â select_frame (fi);
> ! Â Â Â Â Â Â }

The code later in this function is only executed if "within_scope" is
true. Would it be better to call select_frame only if within_scope is
set to true, like this:

if (pc < BLOCK_START (var->root->valid_block) ||
pc >= BLOCK_END (var->root->valid_block))
within_scope = 0;
else
select_frame (fi);

?

- Volodya