General Debugging Strategies

Breakpoints

A useful way to inspect code operation is to insert breakpoints in a Debug session, or resume a stopped Debug session. By doing so, you can have the program execute to a given point and then halt, at which point you can examine variables, memory or other diagnostic data. To insert a breakpoint, double-click to the left of the line number on which you want to stop. See the "Setting a Breakpoint" figure. Details on how to initiate a Debug session are provided in the RSL15 Getting Started Guide.

Setting a breakpoint

Figure: Setting a Breakpoint

Breakpoints are a convenient method of checking that data at various stages is what you expect to see. With breakpoints, you can examine registers, variables and memory when debugging.

Debugging Best Practices

One bug can sometimes hide another, so do not ignore bugs you find that are unrelated to the one you are actively trying to fix. Remember, if you fix another bug, be sure to go back and try to reproduce the first one again.

When looking at problems with memory allocation, check that you did indeed allocate the right amount of memory, and check that you initialized it.