How do I set persistent and conditional watchpoints on locally scoped variables?
I agree with Dave that a conditional breakpoint is the way to go. However, to do what you asked, you can use GDB’s commands command to set a list of GDB commands to execute whenever a breakpoint is hit. I find this incredibly useful. I suggest writing your GDB commands into a file so that … Read more