Evaluation Platform Board Manual 67
B.9 Debugging Basics

B.9.1 Overview

Debuggers allow developer s to interrogate application code b y allowing program flow contr ol, data
observation, and data manipulation. The flow control functions include the ability to sing le-step
through the code, step into fu nctions, step over functions, a nd run to breakpoint (hardwar e or
software). The data observation and manipulation functions include access to mem ory, registers, and
variables. The combination of the flow control and data functio ns allows the developer to debug
problems as they occur or to validate the application code. As the size of an ap plication grows, the
need to be able to narrow down the cause of a problem to a few lines of code is imperative.
Debuggers have a finite set of capabilities and limitations. Debugg ers can give insight that is difficult
to obtain without them, but they can fail wh en they are not used within the limits of their
functionality. They are intrusive by defi nition. They are software pro grams that interact with softwar e
monitors or hardware (JTAG) to control a target program. U ltimately, the debugger works best when
the developer understands wha t it can and can not do and uses it w ithin those constraints.

B.9.2 Hardware and Software Breakpoints

The following section provide s a brief overview of breakpoin ts. See the Intel® 80332 I/O Processor
Developer’s Manual, for more detailed information.

B.9.2.1 Software Breakpoints

Software breakpoints are setup and utilized via debugger utilities (such as Code|Lab). The abi lities of
software breakpoints were seen in SectionB.7 of this Guide. Program execu tion can be halted at a
particular line of code, stepp ed through, and executed again to the next breakpoint via debugge rs.
During this process, register values, memory address contents, variable contents, and man y other
useful pieces of information can be monitored.

B.9.2.2 Hardware Breakpoints

Hardware breakpoints step and breakpoint in code in either ROM or RA M without altering the code,
stacks, or other target informa tion. Hardware breakpoints ha ndle difficult issues, by providin g the
ability to set the processor conditions tha t cause the program to halt. Use hardware breakpo ints to
locate problems such as reentrance, obscure timing, etc.
The 80332 contains two instru ction breakpoint address reg isters (IBCR0 and IBCR1), one da ta
breakpoint address register (DBR0), one configurable data mask/address register (DBR1), and one
data breakpoint control register (DBCON). The 80332 also supp orts a 256 entry, trace buffer, that
records program execution information. The registers to control the trace bu ffer are located in CP14.