Hi, whilst debugging code running on my XC161board i cant seem to modify the locals in the watch window. Does anyone know why this is?
"what make them decide to be in registers?"
It's the compiler that decides.
"can i change this behaviour?"
You might be able to change it via the compiler's Optimisation settings - see the Manual for details...
This is a very valid question!
The whole point of an IDE is that it's supposed to be Integrated - that's what the 'I' stands for, isn't it?
[rant] How can this be called "Integrated" if the Keil debugger can't even understand such basic optimisations as this done by the Keil compiler?!
This is not some fancy new and revolutionary optimisation technique; compilers - including Keil compilers - have been doing it for years! Is the state of debugger technology really this far behind?! [/rant]
It depends a bit.
All real debuggers should support edit of variables even if stored in registers.
The problem comes when the variable is only used in some part of a function. The compiler may then reuse the register for a different variable in other parts of the function. The result is that the variable goes out of scope for the debugger, even if you still are within the block scope of the source code.
"result is that the variable goes out of scope for the debugger, even if you still are within the block scope of the source code."
That's true, although a truly integrated debugger worthy of the name should be able to cope with it.
The trouble really is that the debugger technology (certainly within uVision) really is a long way behind the compiler technology - especially when it comes to oprimisation.
:-(