Professional Documents
Culture Documents
Introduction
Starting GDB
Supported architectures
Basic Concepts
Introduction
The TRACE32 Software contains an interface to connect to GDB (or any other application using the Remote
Serial Protocol) via UDP or TCP. TRACE32 implements a gdbserver functionality: it receives commands
from GDB, executes them and sends the response back to GDB.
The command chain using TRACE32 GDB API looks like that:
GDB <-----> TRACE32 display driver <----> TRACE32
(sockets)
(HW interface)
GDB
TCP/IP
Socket
Interface
Ethernet
TCP/IP
Socket
Interface
TRACE32
display driver
Ethernet
Parallel
Fiberoptic
TRACE32
Hardware
The communication to the TRACE32 display driver is implemented as a socket interface. This means, that
GDB and the display driver can reside on two different hosts, using network connections for communication.
The display driver just routes the GDB requests to the TRACE32 Hardware. This interface is the one, you
choose for your emulator. E.g. it could be Ethernet, parallel or optical interface.
The answers for the request go exactly the opposite way, returning information to GDB.
Basic Concepts
Basic Concepts
Communication Setup
PACKLEN specifies the maximum package length in bytes for the socket communication.
PORT specifies the port number for communication. The default port is 30000. If this port is already in use,
try one higher than 30000.
PROTOCOL specifies the used protocol (TCP or UDP). Default is UDP.
Starting GDB
Start GDB with object file as argument:
C:\>gdb.exe sample.elf
<ip> is the remote ip or 127.0.0.1 if GDB and the TRACE32 display driver are on the same machine.
Supported architectures
The GDB API supports the architectures ARM, ARM64, PowerPC, MIPS32, SH, MicroBlaze, 68K, Intel
x86and Intel x86 64. Other architectures could be supported on request.
Communication Setup
?: Get debugger status. TRACE32 replies with S00 if the debugger is in Down state otherwise with
T packet.
c, C: Continue. The signal information within the C packet is not used by TRACE32.
d: Toggle debug flag. When debug mode is enable, TRAC32 will print the received/sent packets
in the AREA window.
G: Write general registers (not supported for MIPS5k, please use instead the P packet).
m: Read memory.
M: Write memory.
qRcmd: GDB monitor command. TRACE32 defines three types of monitor commands:
(gdb)
monitor help
Communication Setup
R, r: Reset.
s, S: Single step. The signal information within the S packet is not used by TRACE32.
Z, z: Set/Remove a breakpoint.
Communication Setup