GDB: Using memory watch points
While programming, we've all seen it.
"Why the hell is that variable set to 1? It should be X!"
A lot of programmers would stack print statements around till the find the issue. Others, might look at function calls.
But in the arsenal of the programmer, is the debugger. Normally, the debugger, is really overkill, and too complex to really solve a lot of issues. But while trying to find an issue like this, it shines.
All the code we are about to discuss is in the liblfdb git