I like to make GDB set a break point when a variable equal some value I set, I tried this example:
#include main() { int i = 0; fo
You can use a watchpoint for this (A breakpoint on data instead of code).
You can start by using watch i. Then set a condition for it using condition i == 5
watch i
condition i == 5
You can get the breakpoint number by using info watch
info watch