You are on page 1of 10

DEBUGGING TOOLS

Definition -Debugging
Debugging is the routine process of locating and removing computer program bugs,
errors or abnormalities, which is methodically handled by software programmers via
debugging tools. Debugging checks, detects and corrects errors or bugs to allow proper
program operation according to set specifications. Also known as debug.
Aside from creating the architecture, debugging code is probably the most difficult task
of the development cycle. Debugging is primarily the task of locating and fixing errors
within the system. This task is made simpler when the programmer is familiar with the
various types of debugging tools available and how they can be used (the type of
information. As seen from some of the descriptions in Table1, debugging tools reside and
interconnect in some combination of standalone devices, on the host, and/or on the target
board.

Tool type
Hardware

Debugging tools
In-Circuit

description
Active device

Emulator

replaces

(ICE)

microprocessor

Examples uses and drawbacks


Typically most expensive
debug solution, but has a
lot of debugging

in system

capabilities

Can operate at the full


speed of the processor
(depends on ICE) and to
the rest of the system it is
the microprocessor

Allows visibility and


modifiability of internal
memory, registers,
variables, etc. real-time

Similar to debuggers,
allows setting
breakpoints, single
stepping, etc.

Usually has overlay


memory to simulate
ROM

ROM Emulator
Hardware

Active tool

processor dependent

Allows modification of

replaces ROM

contents in ROM (unlike a

with cables

debugger).

connected to

dual port RAM

ROM code, and view

within ROM
emulator,
simulates ROM.

ROM code real-time

Usually doesnt support


on-chip ROM, custom

It is an

ASICs, etc.

intermediate
hardware device

Can set breakpoints in

Can be integrated with


debug

connected to the
target via some
cable (i.e.
BDM), and
connected to the
host via another
port
Hardware

Background

BDM hardware

Debug Mode

on board (port

ICE, but not as flexible

(BDM)

and integrated

as ICE

debug monitor

usually cheaper than

observe software

into master

execution unobtrusively

CPU), and

in real time v can set

debugger on

breakpoints to stop

host, connected

software execution

via a serial
cable to BDM
port. The
connector on

allows reading and


writing to registers,
RAM, I/O ports, etc

cable to BDM

port commonly

processor/target
dependent, Motorola

referred to as

proprietary debug

wiggler. BDM

interface

debugging
sometimes
referred to as
On-Chip
Debugging
(OCD)
Hardware

Hardware

IEEE 1149.1 Joint

JTAG-

Test Action Group

compliant

proprietary to specific

(JTAG)

hardware on

architecture (is an open

board

standard)

similar to BDM, but not

IEEE-ISTO

Options of

Nexus 5001

JTAG port,

functions depending on

Nexus-

level of compliance of

compliant port,

offers scalable debug

hardware

or both, several
layers of
compliance
(depending on
complexity of
master
processor,
engineering
Hardware

Oscilloscope

choice, etc.)
Passive analog

device that
graphs voltage

monitor up to 2 signals
simultaneously

can set a trigger to

(on vertical

capture voltage given

axis) versus

specific conditions

time (on
horizontal axis),

used as voltmeter
(though a more

detecting the
exact voltage at

expensive one)

a given time

can verify circuit is


working by seeing signal
over bus or I/O ports

capture changes in a
signal on I/O port to
verify segments of
software are running,
calculate timing from
one signal change to
next, etc.

Hardware

Logic Analyzer

Passive device

processor independent

can be expensive

that captures

Logic Analyzer

.typically can only track

and tracks

2 voltages (VCC and

multiple signals

ground); signals in-

simultaneously

between are graphed as

and can graph

either one or the other

them

(continued)

can store data (whereas


only storage
oscilloscopes can store
captured data)

2 main operating modes


(timing, state) to allow
triggers on changes of
states of signal (i.e.,
high-to-low or low-tohigh)

capture changes in a
signal on I/O port to
verify segments of
software are running,
calculate timing from

one signal change to


next, etc. (timing mode)

can be triggered to
capture data from a clock
event off the target or an
internal logic analyzer
clock

can trigger if processor


accesses off-limits
section of memory,
writes invalid data to
memory, or accesses a
particular type of
instruction (state mode)

some will show assembly


code, but usually cannot
set break point and
single-step through code
using analyzer .logic
analyzer can only access
data transmitted
externally to and from
processor, not the
internal memory,
registers, etc.

processor independent
and allows view of
system executing in real
time with very little
intrusion

Hardware

Voltmeter

Measures

voltage
difference

to measure for particular


voltage values

to determine if circuit

between 2
points on circuit
Hardware

Ohmmeter

has any power at all

cheaper then other

Measures

hardware tools
cheaper than other

resistance

hardware tools

between 2

points on circuit

to measure changes in
current/voltage in
terms of resistance

Hardware

Multimeter

measures both

voltage and

(Ohms Law V=IR)


same as volt and ohm
meters v

resistance
Software

Debugger

Functional

debugging tool

Depends on the debugger


in general:

loading/single
stepping/tracing code on
target

implementing
breakpoints to stop
software execution

implementing
conditional breakpoints
to stop if particular
condition is met during
execution

can modify contents of


RAM, typically cannot
modify contents of ROM

Software

Profiler

Collects the

capture time dependent

timing history

(when) behavior of

of selected

executing software

variables,
registers,

to capture execution
pattern (where) of

Software

Monitor

Debugging

executing software
similar to print statement

interface similar

but faster, less intrusive,

to ICE, with

works better for soft real-

debug software

time deadlines, but not

running on
target and host.

for hard real-time

similar functionality to

Part of monitor

debugger (breakpoints,

resides in ROM

dumping registers and

of target board

memory, etc.)

(commonly
called debug

embedded OS es can
include monitor for

agent or target

particular architectures

agent), and a
debugging
kernel on the
host. Software
on host and
target typically
communicate
via serial or
Ethernet
(depends on
what is
available on
target).
Software

Instruction Set

Runs on host

typically does not run at

Simulator

and simulates

exact same speed of real

master

target, but can estimate

processor and

response and throughput

memory

times by taking in

(executable

consideration the

binary loaded

differences between host

into simulator

and target speeds .verify

as it would be

assembly code is bug

loaded onto
target) and

free

mimics the

usually doesnt simulate


other hardware that may

hardware

exist on target, but can


allow testing of built-in
processor components

can simulate interrupt


behavior

capture variable, memory


and register values

more easily port code


developed on simulator
to target hardware v will
not precisely simulate the
behavior of the actual
hardware in real-time

typically better suited for


testing algorithms rather
than reaction to events
external to an
architecture or board
(waveforms and such
need to be simulated via
software)

typically cheaper than


investing in real
hardware and tools

Manual R

Readily available,
free or cheaper
than other
solutions,
effective, simpler

to use but usually


more highly
intrusive than
other types of
tools, not enough
control over event
selection,
isolation, or
repeatability.
Difficult to debug
real-time system
if manual method
takes too long to
execute
Software

Print Statements

Functional

debugging tool,

variables, register values,

printing

etc. while the code is

statements
inserted into

running

code that print


variable
information,
location in code
information,
etc.
Software

Dumps

Functional

to see output of

to verify segment of code


is being executed

can significantly slow


down execution time

can cause missed


deadlines in real-time

system
same as print statements

debugging tool

but allows faster

that dumps data

execution time in

into some type

replacing several print

of storage

statements (especially if

structure at

there is a filter

runtime

identifying what specific


types of information to
dump or what conditions

need to be met to dump


Software

Counters/Timers

Performance

data into the structure)


collect general execution

and efficiency

timing information by

debugging tool

working off system

in which

clock or counting bus

counters or

cycles, etc. v some

timers reset and

intrusiveness

incremented at
various points
Software

Fast Display

of code
Functional

debugging tool

but faster, less intrusive,

in which LEDs

working well for real-

are toggled or

time deadlines

simple LCD

displays present
Output ports

Performance,

allows confirmation that


specific parts of code

some data
Software

similar to print statement

running

efficiency, and

with an oscilloscope or
logic analyzer, can

functional

measure when port is

debugging tool

toggled and get

in which output

execution times between

port toggled at

toggles of port

various points
in software

same as above but can


see on oscilloscope that
code is being executed
in first place v in
multitasking/multithread
ed.

Table 40.1: Debugging tools

You might also like