To create a watchpoint on err_silent:
Select the err_silent variable, right-click, and choose New Breakpoint.
Set Breakpoint Type to Access.
Note how the Settings section changes and how the Address field is & err_silent.
Select After in the When field.
Select Write in the Operation field.
Click OK.
Run the program.
You stop in init(). err_silent was incremented to 1 and execution stopped after that.
Click Continue.
You stop in init() again.
Click Continue again.
You stop in init() again.
Click Continue again.
You stop in init() again.
Click Continue again.
Now you stop in stopIn(). Things look OK here too, with no -1s.
Instead of clicking Continue over and over until err_silent is set to -1, you can set a breakpoint condition.