
October 13 1995, Draft 1
374
Addendum to –– Evaluating and Programming the 29K RISC Family
Users are free to incorporate their own real–time operating system, or alterna-
tively make use of the HIF operating system module. Because GDB is available in
source form, it can be extended to understand real–time operating system support
data structures. Purchasers of third party executives, or those who choose to build
their own, should not find it difficult to extend GDB to analyze the real–time operat-
ing system control parameters, via the Universal Debugger Interface standard.
The increased complexity of many applications being solved by RISC proces-
sor designs have a corresponding increase in software complexity. The low cost of
GDB and its associated productivity make it an attractive choice for developers.
7.6
SIMPLIFYING ASSEMBLY CODE DEBUG
It would be ideal to have a whole chapter dedicated to the subject of Designing
for Debug. However, size constraints have restricted this section to a few hints about
how to better develop assembly code. Certainly those developing 29K based systems
should first consider the difficulties (if any) of connecting logic analyzers, ROM
emulators or in–circuit emulators to their designs before constructing any circuitry.
Tool suppliers as well as AMD support services and literature provide useful in-
formation with regard to
planning for debug
. This information should be obtained
and studied at the early stages of a project.
When developing a program in a high level language such as C, the compiler can
be direct to provide the necessary debug information in the output object file (COFF
file). With the High C 29K compiler, as with most C compilers, the “–g” switch in-
forms the compiler that additional debug information should be provided by the com-
piler. Source level debuggers, such as UDB or GDB, need the additional information
in order to correctly perform their task. Using High C, it is possible to examine the
assembly level directives which result from the use of the “–g” compiler switch. For
example, use the command “hc29 –S –Hanno –g file.c” to produce a file called
“file.s” which has high level language debug directives embedded among the 29K
assembly code.
When developing programs at assembly level it is best to include the high level
debug directives –– too frequently assembly language developers omit this task. Di-
rectives can be added to provide symbol–table and line number information for the
assembly files. This simplifies the task of later debugging the assembly code. For ex-
ample, the
swaf
utility can be used to read COFF files and produce an information file
in Hewlett Packard’s General Purpose Ascii (GPA) format. The GPA file can be
loaded into an HP16500B logic analyzer, enabling the analyzer to display symbol in-
formation rather than, say, hex address values. Further, using HP’s B3740A Software
Analyzer product in conjunction with their logic analyzer, trace of source line execu-
tion is possible if line number information has been provided.