This is the mail archive of the
mailing list for the GDB project.
Re: BUG: MI reporting wrong attributes for casted variables
- From: Nick Roberts <nickrob at snap dot net dot nz>
- To: "Srrr" <ibx at gmx dot net>
- Cc: <gdb at sourceware dot org>
- Date: Fri, 22 Jun 2007 08:17:39 +1200
- Subject: Re: BUG: MI reporting wrong attributes for casted variables
- References: <000001c7b427$5822d330$02b2a8c0@insanenotebook>
> unsigned int myValue;
> It is possible to create a casted MI variable like
> 1096-var-create - * (int)myValue
> GDB reports this to be an editable variable:
> 1097-var-show-attributes var4
> But in fact, it is not. GDB does not allow assiging values to casted
> variables. So GDB should not report this to be editable.
> 1100-var-assign var4 1
> 1100^error,msg="mi_cmd_var_assign: Could not assign expression to varible
> This bug is causing trouble in Eclipse CDT because casted vars show up as
> editable when they are not.
> GDB Snapshot from around 26.5.2007.
Report it as a bug to the Eclipse CDT team. They have misinterpreted the
meaning of the "editable" attribute.
This has been reported at leasted once before, possibly by you (or at least
another Sascha using Eclipse CDT) when I said:
The fact that the var has the attribute "editable" is a bit of a red herring.
A value can't be assigned because (int)myValue isn't an lvalue. You get the
same error if you do:
-var-create - * 2*myValue
-var-assign var36 0x1234
I think it only makes sense to watch such values.
Having said all that, I think we should add another field "lvalue" or
"unassignable", say, to the output of -var-show-attributes so that IDE's
like Eclipse can determine which variables can be assigned a value.