2-6
DINK32 PowerPC ISA Debugger User’s Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Interacting with DINK
Otherwise (if not an editing or VT102 sequence), DINK stores the characters into a buffer
until a newline character is seen (0x0A—generally ENTER on the keyboard). Once a line
is complete, the DINK shell looks for the presence of a semicolon (;), indicating that more
than one command is present. If found, DINK separates the line into one or more
commands and executes them separately. For example, the command ‘rd r; md 1000’ will
display the register file and memory starting at location 0x1000.
For each command portion, DINK examines the line and alters it according to these rules:
— The character ‘$’ followed by an existing environment variable name is replaced
with the value of the environment variable. For example, assuming ‘env
RX=r3-r7,r15-r31’ has been defined, ‘rd $RX’ will show the indicated registers.
— The characters ‘@R’ followed by a number from 0 to 31 are replaced with the
contents of the indicated GPR. For example, ‘md @R1’ shows memory at the
current stack pointer.
— The quote characters (‘, “) prevent DINK from examining/altering the value
between the starting quote and the ending quote. For example, “env RD=@R1”
sets the variable RD to “@R1”, literally.
Once the command has been edited as stated previously, it is passed to the various programs
for further interpretation. Entering ‘help’ shows a list of commands, and ‘help’ plus the
command name (such as he rd) shows details on command options.
2.5.1
Running External Programs
In order to run user programs, the user must compile and link a program to start at
0x100000 or higher. Various PowerPC compilers are available to convert user programs to
executable files.
Once the file is ready, it needs to be transferred to DINK’s memory space. DINK supports
S-record or binary file (including ELF), and such files can be downloaded either through a
serial port or by ethernet. Once in memory, the loaded code can be set into action with either
a go or trace command. The demo directory and Appendix B, “Example Code,” have
examples of compiling programs for this purpose.
2.5.2
Assigning Breakpoints
A breakpoint halts execution of user code at arbitrary locations, allowing inspection of the
processor and memory state at a particular point. Breakpoints are set with the ‘bp’
command along with one or more desired stop-point addresses. When ‘go’ or ‘tr’ are used
to run code, execution will be halted and DINK will restart when any breakpoint addresses
are encountered.
Executing ‘go’ or ‘tr’ on top of a breakpoint deletes the breakpoint—this allows ease in
stepping over a breakpoint, but caution is required for breakpoints in loops.
F
Freescale Semiconductor, Inc.
n
.