int global = 0;
int main() {
int local = 0;
local = 1;
global = 1;
}
I can create a watchpoint for global
with:
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.
Related: Setting Memory Breakpoints in Eclipse
It seems the Toggle Watchpoint command are note yet implemented for local variables: see Eclipse bug 110016:
As workaround you can manually set watchpoints for local variables via GDB in the Console view: see Eclipse CDT + GDB: Setting Watchpoints (Juno)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With