RE: [Patch] -var-evaluate-expression NAME [FORMAT]

Marc Khouzam
2008-02-04T17:00:48Z

> > Here is the revised patch.

My patch no longer works with the patch Vladimir applied
http://sourceware.org/ml/gdb/2008-02/msg00006.html
The reason is that Vladimir's patch has c_value_of_variable()
always use the stored print_value which is formatted based on the
current display format (and not the one specified as an option
to -var-evaluate-expression.) I think that is a good way to do it.

One solution is to revert c_value_of_variable:
- return xstrdup (var->print_value);
+ return value_get_print_value (var->value, var->format);

Although this is very easy, personally, I don't like that too much.

Another option is to not only temporarily set var->format
but also var->print_value (by calling varobj_set
I think a solution based on
http://sourceware.org/ml/gdb-patches/2008-01/msg00531.html

>
> This looks fine. All it needs, to be checked in, is a ChangeLog
> entry. Could you give that a try?

I updated gdb/ChangeLog, gdb/testsuite/ChangeLog and gdb/doc/ChangeLog

> As for how it gets checked in, I can take care of that; or if you
> would like write-after-approval access to the repository, please fill
> out the form from the front page of sourceware.org and list me as
> approving it.

Thanks! I filled the form. I gather you should get it soon.

>
> Except for one small problem :-( We seem to have skipped a step. Do
> you have a copyright assignment in place? I can't find a record of
> it.