User`s manual

Dynamic C Users Manual digi.com 91
6. DEBUGGING WITH DYNAMIC C
This chapter is intended for anyone debugging Dynamic C programs. For the person with little to no expe-
rience, we offer general debugging strategies in Section 6.5. Both experienced and inexperienced Dynamic
C users can refer to Section 6.3 to see the full set of tools, programs and functions available for debugging
Dynamic C programs. Section 6.4 consolidates the information found in the GUI chapter regarding debug-
ging features into an quicker-to-read table of GUI options. And lastly, Section 6.6 gives some good refer-
ences for further study.
Dynamic C comes with robust capabilities to make debugging faster and easier. The debugger is highly
configurable; it is easy to enable or disable the debugger features using the Project Options dialog.
6.1 Debugging Features Prior to Dynamic C 9
The following features are available prior to Dynamic C 9. They are summarized here, with links to more
detailed descriptions.
printf() - Display messages to the Stdio window (default) or redirect to a serial port. May also write to a
file.
Software Breakpoints - Stop execution, allow the available debug windows to be examined: Stack,
Assembly, Dump and Register windows are always available.
Single Stepping - Execute one C statement or one assembly statement. This is an extension of break-
points, so again, the Stack, Assembly, Dump and Register windows are always available.
Watch Expressions - Keep running track of any valid C expression in the application. Fly-over hints
evaluate any watchable statement.
Memory Dump - Displays blocks of raw values and their ASCII representation at any memory location
(can also be sent to a file).
MAP File - Shows a global view of the program: memory usage, mapping of functions, global/static
data, parameters and local auto variables, macro listing and a function call graph.
Assert Macro - This is a preventative measure, a kind of defensive programming that can be used to
check assumptions before they are used in the code. This was introduced in Dynamic C 8.51.
Blinking Lights - LEDs can be toggled to indicate a variety of conditions. This requires a signal line
connected to an LED on the board.