Introduction to setting and using breakpoints
Reasons for using breakpoints
C-SPY® lets you set various types of breakpoints in the application you are debugging, allowing you to stop at locations of particular interest. You can set a breakpoint at a code location to investigate whether your program logic is correct, or to get trace printouts. In addition to code breakpoints, and depending on what C-SPY driver you are using, additional breakpoint types might be available. For example, you might be able to set a data breakpoint, to investigate how and when the data changes.
You can let the execution stop under certain conditions, which you specify. You can also let the breakpoint trigger a side effect, for instance executing a C-SPY macro function, by transparently stopping the execution and then resuming. The macro function can be defined to perform a wide variety of actions, for instance, simulating hardware behavior.
All these possibilities provide you with a flexible tool for investigating the status of your application.
Briefly about setting breakpoints
You can set breakpoints in many various ways, allowing for different levels of interaction, precision, timing, and automation. All the breakpoints you define will appear in the Breakpoints window. From this window you can conveniently view all breakpoints, enable and disable breakpoints, and open a dialog box for defining new breakpoints. The Breakpoint Usage window also lists all internally used breakpoints, see Breakpoint consumers.
Breakpoints are set with a higher precision than single lines, using the same mechanism as when stepping. For more information about the precision, see Single stepping.
You can set breakpoints while you edit your code even if no debug session is active. The breakpoints will then be validated when the debug session starts. Breakpoints are preserved between debug sessions.
Note
For most hardware debugger systems it is only possible to set breakpoints when the application is not executing.