User`s manual

Source-Level Debugging in C
Motorola Debugging C and Assembly Code 3-5
3.1.7 Displaying Memory
To display blocks of memory in the graphic user interface, from the
Windows menu, choose Memory. A dialogue box appears for you to
indicate which parts of memory you want to display. (The parts available
for display vary according to the target device.) The Suite56 tool will then
open a window, labeled with the device and memory blocks you have
chosen, and display the block names and values. That window is interactive: you can both
see and modify memory contents there.
To display memory in the text-based interface, type the command
display with no
options to display all enabled memory blocks, or with option
on followed by the list of
memory blocks you want to see for a more selective display.
3.2 Source-Level Debugging in C
The C code in Example 3 -2 on page 3-7 implements a long-term predictor (LTP). This
type of code often appears in such applications as GSM vocoders and other voice
compression algorithms.
The routine
main initializes two input buffers and then invokes the routine ltp. This
routine consists of an internal and external loop, which together compute a sum of
products calculated from elements of the two input arrays. In other words,
ltp
implements a convolution. To do so, it uses these features:
The two arrays,
signal_lin[] and signal_dpri[], are vectors of fractions.
Fractional multiplication is performed by
result = lmult (inp1, inp2).
Fractional addition is performed by
result = add_long (inp1, inp2).
With this example, we will highlight these debugging tasks: setting breakpoints and using
the
go command effectively; defining a watch list; tracing; evaluating C expressions
(Don’t forget the curly brackets!); and casting.
Note: The C code in Example 3 -2 will not actually link successfully. It lacks the
definition of two C library routines,
add_long(); and lmult();. Because
both of those routines are platform-dependent, in a linkable example, we use
#define for those definitions.