Suppose I start a gdb session and create a breakpoint and start.
After I break, I create a watchpoint based on the memory address of the character in the current execution and delete the original breakpoint.
After some time, I interrupt the program using Control-C, still inside gdb, I run the command runto restart the program from the very beginning.
However, I would like to keep the hardware monitoring point for restarting the debugged process.
Is there a gdb option that allows me to save hardware watchpoints during re-launches?
Update: here is an example to reproduce the problem.
int main(){
int NeverGoOutOfScope = 0;
NeverGoOutOfScope = 7;
while (1);
}
Here is the sequence of commands gdb.
break 3
run
watch NeverGoOutOfScope
info watch
run
info watch
?