int global = 0;
int main() {
int local = 0;
local = 1;
global = 1;
}
I can create a watchpoint for global
with:
- highlight the variable declaration
- Run -> Toggle watchpoint
and then the program breaks whenever global
is modified.
However, if I try this with local
an error popup appears:
This operation is unavailable on the current selection. Please select or place the cursor on a field.
GDB allows that with the watch
command, using hardware watchpoints.
I know that this can give weird results if the stack frame exits, but that is fine.
Eclipse 4.7.0, CDT 9.3, Ubuntu 16.04.