User`s manual
3-18 Suite56 DSP Tools User’s Manual Motorola
Source-Level Debugging in C
These are the C-specific debugging commands:
•
down moves down the C function call stack. In the graphic user interface, from the
Modify menu, choose Down.
•
frame designates the current frame in the C function call stack. (The current frame
determines the scope for evaluation.) In the graphic user interface, from the
Display menu, choose Call Stack.
•
redirect redirects standard input (stdin) and standard output (stdout and
stderr). With it, you can make stdin take data from a file and send standard
output to files. In the graphic user interface, from the File menu, choose
I/O Redirect.
•
streams enables and disables input and output on the host side for C programs. In
the graphic user interface, from the File menu, choose I/O Streams.
•
type accepts a C expression enclosed in curly brackets {} as its argument and
displays the type of the return value of that expression. In the graphic user
interface, from the Display menu, choose Type.
•
up moves up the C function call stack. In the graphic user interface, from the
Modify menu, choose Up.
•
where displays the C function call stack. With no options, it displays the entire
stack. With a numeric option, you tell it how many frames of the stack to display.
In the graphic user interface, from the Display menu, choose Call Stack.
3.2.13 Profiling a C Program
After you have loaded your C program into a Suite56 simulator, you can profile the
program as it executes. The profiler counts the number of instructions of each type in the
program, calculates their percentage of the program, and analyzes the number and type of
instructions actually executed. It also analyzes addressing modes used with respect to
instruction types. It assesses interaction between subroutines during execution. It
computes the runtime of the program execution in terms of clock cycles. Finally, it places
its results in two files; one file, with the extension .
log, is an ordinary ASCII text file,
formatted in 80 columns; the other, with the extension
.ps, contains a PostScript version
of the same results for nicely formatted output from a PostScript printer with appropriate
fonts. Only the Suite56 simulator offers these profiling facilities.
To profile your program, in the graphic user interface of the simulator, first load both
memory and symbols. Next, from the File menu, choose Log, and then select Profile.A
dialogue box appears for you to indicate the name and location of the log file to contain
the profile that the tool will generate. Profiling will continue until you click the File menu