Prevent gdb from stopping at watchpoints -
file main.c:
#include <stdio.h> int main() { int i; (i=0; i<30 ;i++) { printf ("%d\n", i); } return 0; }
in gdb, set breakpoint, specify watchpoint command executed on breakpoint:
(gdb) break main breakpoint 1 @ 0x4004b0: file main.c, line 6. (gdb) command type commands when breakpoint 2 hit, 1 per line. end line saying "end". >watch >end
execution gonna stop whenever watched variable changed, problem there no way(to knowledge) tell gdb print value of watched variable , continue because nested watchpoint. if standalone watchpoint done using command 'continue' (when i'm in scope if main()):
(gdb) watch hardware watchpoint 2: (gdb) command type commands when breakpoint 2 hit, 1 per line. end line saying "end". >continue >end
so, there way gdb not stop on nested watchpoint, , print value change? or better yes, specify commands executed on nested watch/breakpoints?
i further tried 'set complaints 0' , 'set confirm off' in gdb no avail
gdb has no concept of nested watchpoints. breakpoints , watchpoints @ top level, regardless of you've set them.
here want:
(gdb) break main breakpoint 1 @ 0x40052c: file t.c, line 6. (gdb) commands >watch >commands >c >end >c >end
this sets command list on breakpoint 1:
watch continue
and separate command list on watchpoint (when created):
continue
Comments
Post a Comment