About this task
You can make your programs easier to debug by following these
simple guidelines:
- Where possible, do not put multiple statements on a single line, because
some debugger features operate on a line basis. For example, you cannot step
over or set line breakpoints on more than one statement on the same line.
- Assign intermediate expression values to temporary variables to make it
easier to verify intermediate results by monitoring the temporary variables.
- If you have a bug in a complex expression, you can debug the expression
more easily by breaking it down into intermediate values and by assigning
those values to temporary variables. This allows you to verify each expression
and variable.
To debug programs at the level of source code statements, you must
specify the compiler options that generate debugger information. In some cases,
you must specify additional options that enable the debugging engine to work
properly with your code.