Re: Variable objects laziness

Daniel Jacobowitz
2006-11-17T18:12:55Z

On Fri, Nov 17, 2006 at 08:17:04PM +0300, Vladimir Prus wrote:
> - if (gdb_evaluate_expression (var->root->exp, &var->value))
> + if (gdb_evaluate_expression (var->root->exp, &value))
> {
> /* no error */
> - if (value_lazy (var->value))
> - gdb_value_fetch_lazy (var->value);
> }
> else
> - var->value = evaluate_type (var->root->exp);
> + value = evaluate_type (var->root->exp);

Noticed while working on another patch: can you kill the empty braces
here, please (by negating the if/dropping the else).

> + /* Need to coerce the input. We want to check if the
> + value of the variable object will be different
> + after assignment, and the first thing value_assign
> + does is coercing the input.

"is coerce"

> + For example, it means that if assigning array to
> + a pointer variable, we'll be comparing pointer with array's
> + address, not pointer with array's content. */

For example, if we are assigning an array to a pointer variable we
should compare the pointer with the the array's address, not with the
array's content.

> + /* The new value may be lazy. gdb_value_assign, or

Two spaces after period please.

> + rather value_contents, will take care of this.
> + It might throw, but unlike var-update for -var-assign
> + there's just one variable we're working it, so we don't
> + need to catch the exception here. */

Wait, what? gdb_value_assign will never throw. value_contents
might, but gdb_value_assign will catch it.

> + Return 1 if so, and 0 is the values are equal. */

if, not is.

> + /* We must always keep the new value, since children depend on it. */

Two spaces after periods please.

--
Daniel Jacobowitz
CodeSourcery