Reputation: 8115
OK this question appears many times across many context on the web. However, I am yet to find a sufficient answer. It seems like there is no way of displaying globals in the Debug/Variables view. A workaround this is to use the Expressions view. This is fine for watching the variables, but it won't let you change their contents, as in the Variables view.
Now, one could do so via the Memory view. This is OK when dealing with simple variables, but gets complicated when dealing with compound objects (e.g., structures).
So, how can you easily watch and change the values of globals and static variables in Eclipse CDT?
Upvotes: 2
Views: 1906
Reputation: 8115
It seems that changing value of global variables is possible in the Expressions view. From some reason this did not work earlier, which is why I asked this question.
Obviously, it can only work when the expression is an lvalue.
(I am not deleting this question just in case it will be helpful to someone in the future, but if the mods think it should be deleted, that's fine with me)
Upvotes: 2