I am working on a lengthy C code split across different files. While debugging, I would like the simulation to stop wherever the value of a certain parameter is changed (not to a specific value).
I have come across watchpoint and watch expression feature in eclipse what is the difference, what would be best suited to track a certain parameter?
Not an expert here, so please be kind :) Thanks :)
According to official docs at Watchpoints:
A watchpoint is a special breakpoint that stops the execution of an application whenever the value of a given expression changes, without specifying where it might occur. Unlike breakpoints (which are line-specific), watchpoints are associated with files. They take effect whenever a specified condition is true, regardless of when or where it occurred. You can set a watchpoint on a global variable by highlighting the variable in the editor, or by selecting it in the Outline view.
To set a watchpoint on a global variable:
Do any of the following:
To stop execution when the watch expression is read, select the Read check box.
To stop execution when the watch expression is written to, select the Write check box.
So, I guess, the watchpoint itself is defined by the watchpoint expression.