This is the mail archive of the gdb@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]

Assigning values to type casted vars


Hi,

Eclipse CDT supports casting variables to a different type. This is done by
creating an MI var like this:

1466-var-create - * (int)myValue
1466^done,name="var35",numchild="0",value="1",type="int"

1467-var-show-attributes var35
1467^done,attr="editable"

The var is "editable". But in most cases GDB does report an error when
assigning a value to the var:

1472-var-assign var35 0x1234
1472^error,msg="mi_cmd_var_assign: Could not assign expression to varible
object"


The error occurs for most casts like int -> int, int -> char, char -> int,
... . It only seems to work for struct -> int, struct -> short int, ...
(most of the time).

Does this happen for reason, or should I raise a bug ?

Eclipse CDT bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=73598

Sascha


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