You are on page 1of 21

TRACE32 as GDB Front-End

TRACE32 Online Help


TRACE32 Directory
TRACE32 Index
TRACE32 Documents ......................................................................................................................

GDB Support ..................................................................................................................................

TRACE32 as GDB Front-End .....................................................................................................

Operation Theory ....................................................................................................................

GDB Server ..............................................................................................................................

Starting TRACE32 ...................................................................................................................

Quick Start of the TRACE32 GDB Front-end

Troubleshooting ......................................................................................................................

FAQ ...........................................................................................................................................

Background .............................................................................................................................

Multi Process Debugging

Space ID

GDB Front-end Commands ....................................................................................................


SYStem.CPU
SYStem.Mode
SYStem.CpuAccess

Select target CPU

Establish communication to debug agent

Run-time memory access (intrusive)

10

Define byte order (endianess)

10

Define disassembler mode

11

Enable multiple address spaces support

11

SYStem.Option BigEndian
SYStem.Option DisMode
SYStem.Option MMUSPACES
SYStem.Option GDBEXTENDED

Enable/disable gdb extended mode

11

Enable/disable non-stop mode

12

Set communication settings

12

Set the name of the debugged application

13

Set the path to the target libraries on the host

13

Define signal handling

13

List the running processes on the target

14

Select a task for debugging

14

TASK.RUN

Start a new process

14

TASK.KILL

Kill a running process

14

Attach to a running process

14

Detach from a a running process

15

TASK.COPYUP

Copy a file from the target into the host

15

TASK.COPYDOWN

Copy a file from the host into the target

15

SYStem.Option GDBNONSTOP
SYStem.PORT
SYStem.GDBFILE
SYStem.GDBLibPath
SYStem.GDBSIGnal
TASK.List
TASK.SELect

TASK.Attach
TASK.DETACH

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

TASK.Go

Start a single task

15

TASK.Break

Stop a single task

15

Support .....................................................................................................................................

16

Compiler

16

ARM

16

I386

16

MIPS

17

PPC

17

XScale

18

Products ...................................................................................................................................

20

Product Information

20

Order Information

20

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

TRACE32 as GDB Front-End


Version 24-May-2016

Operation Theory
The TRACE32 GDB front-end is a software debugger solution which communicates with a gdbserver/
gdbstub or any other application using the Remote Serial Protocol (RSP) over ethernet or RS232.

GDB Server
The gdbserver is a small program provided by GNU, which allows you to debug an application on a remote
machine. The gdbserver can start a new process or attach to a running one and provide debugging
functionality using mechanisms provided by the operating system as the Process Trace (ptrace) for Linux.
It is recommended to use gdbserver version 6.2 or newer. Some of the functionality described in this manual
as multi-process debugging and non-stop mode are only supported with gdbserver version 7.1 or newer. To
get your gdbserver version, type in the terminal
gdbserver --version

If nothing is printed, then your gdbserver has a version older than 6.2.

Starting TRACE32
To start TRACE32 as GDB front-end, edit your config.t32 file and insert the statement:
PBI=GDB

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

Operation Theory

A typical TRACE32 GDB front-end configuration file in a windows environment looks similar to this (please
take care of the blank lines!):

PBI=GDB
OS=
SYS=.
TMP=.
SCREEN=
FONT=SMALL
; Printer settings
PRINTER=WINDOWS

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

Starting TRACE32

Quick Start of the TRACE32 GDB Front-end


The TRACE32 GDB front-end is set up as follows:
1.

Start the gdbserver :


Usage:

gdbserver [OPTIONS] COMM PROG [ARGS ...]


gdbserver [OPTIONS] --attach COMM PID
gdbserver [OPTIONS] --multi COMM

COMM may be either a serial port (e.g. /dev/ttyS0 or COM1) or a TCP connection (HOST:PORT).
Using the --attach option, the gdbserver attaches to the process with the id PID.
The --multi option start the gdbserver in multi-process mode. This option is not supported by all
gdbserver versions.
2.

Start TRACE32 as a GDB Front-End.

3.

Inform the debugger about the CPU type on your target.


SYStem.CPU ARM920

4.

Define the communication parameters in TRACE32:


SYStem.PORT COM1 baud=9600

or:
SYStem.PORT target_ip:port

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

Starting TRACE32

5.

If using the gdbserver in muti process mode, enable MMUSPACES. Processes of Linux may
reside virtually on the same address. To distinguish those addresses, a debugger uses an
additional space ID, that specifies, to which virtual memory space an address refers. The
following command enables this additional space ID.
SYStem.Option MMUSPACES ON

For more information on the space ID refer to the chapter Space ID.
6.

Establish the communication to the gdbserver:


SYStem.Mode Attach

A typical start sequence is shown below (connection via TCP)


Single process mode:
SYStem.Down
WinCLEAR
SYStem.CPU ARM920
SYStem.PORT 10.1.2.99:2345
SYStem.Mode Attach
Data.LOAD.ELF sieve /NoCODE
Go main
List
ENDDO

;
;
;
;
;
;
;
;

switch the debugger to down state


clear all windows
select your target CPU
define communication parameters
connect to gdbserver
load the process symbols
enter the process
open source code window

;
;
;
;
;
;
;
;
;
;
;
;

switch the debugger to down state


clear all windows
select your target CPU
define communication parameters
enable MMUSPACES
connect to gdbserver
View the list of processes
Start process sieve
Load sieve symbols where 0x2bd is
the space id of the process sieve
enter the process
open source code window

Multi process mode:


SYStem.Down
WinCLEAR
SYStem.CPU ARM920
SYStem.PORT 10.1.2.99:2345
SYStem.Option MMUSPACES ON
SYStem.Mode Attach
TASK.List
TASK.RUN /bin/sieve
Data.LOAD 0x2bd:0 sieve /NoCODE
Go main
List
ENDDO

The start up can be automated by using the programming language PRACTICE.

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

Starting TRACE32

Troubleshooting
No information available until yet.

FAQ
No information available

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

Troubleshooting

Background

Multi Process Debugging


Space ID
Processes of Linux may reside virtually on the same addresses. To distinguish those addresses, the
debugger uses an additional space ID, that specifies, to which virtual memory space an address refers. The
space ID is equal to the process ID.
The command SYStem.Option MMU ON enables the additional space ID.

Space ID

A source code listing for the process helloloop is displayed as follows:

Space ID

A breakpoint to main in the process helloloop can be set with one of the following commands:
Break.Set \\helloloop\global\main
Break.Set 0x91:0x83d4
Break.Set 145.:0x83d4

Please be aware, that process-specific breakpoints are set, as soon as the process is started by Go.

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

Background

GDB Front-end Commands

SYStem.CPU

Format:

Select target CPU

SYStem.CPU <type>

Selects the processor type.

SYStem.Mode

Establish communication to debug agent

Format:

SYStem.Mode <mode>

<mode>:

Down
Attach
Up

Default: Down
Down

TRACE32 has no connection to gdbserver.

Attach

TRACE32 establishes the connection to gdbserver.

Up

TRACE32 is connected to gdbserver.


(Dont use Up to establish the connection!)

If you switch from Up to Down:

The processes currently debugged are killed and the connection is cut. If extended mode is
disabled, the gdbserver is also terminated, otherwise, the gdbserver waits for a new
connection.

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

GDB Front-end Commands

SYStem.CpuAccess

Format:

Run-time memory access (intrusive)

SYStem.CpuAccess Enable | Denied | Nonstop

Default: Denied. .
Enable

Allow intrusive run-time memory access.

Denied

Lock intrusive run-time memory access.

Nonstop

Lock all features of the debugger that affect the run-time behavior.

If SYStem.CpuAccess Enable is set, it is possible to read from memory, to write to memory and to set
software breakpoints while the CPU is executing the program. To make this possible, the program execution
is shortly stopped by the debugger. A red S in the state line of the TRACE32 screen warns you, that the
program is no longer running in real-time.
If specific windows, that display memory or variables should be updated while the program is running select
the memory class E: or the format option %E.
Data.dump E:0x100
Var.View %E first

SYStem.Option BigEndian

Format:

Define byte order (endianess)

SYStem.Option BigEndian [ON | OFF]

Default: OFF.
This option selects the byte ordering mechanism.

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

10

GDB Front-end Commands

SYStem.Option DisMode

Format:

Define disassembler mode

SYStem.Option DisMode <option>

This command specifies the selected disassembler. Different options are available depending on the used
architecture. Please refer to your Processor Architecture Manual (e.g. debugger_arm.pdf for ARM) for more
details.

AUTO

The information provided by the compiler output file is used for the
disassembler selection. If no information is available it has the same behavior
as the option ACCESS.

SYStem.Option MMUSPACES

Format:

Enable multiple address spaces support

SYStem.Option MMUSPACES [ON | OFF]


SYStem.Option MMU [ON | OFF] (deprecated)

Default: OFF.
Enables the usage of the MMU to support multiple address spaces. The command should not be used if
only one translation table is used. Enabling the option will extend the address scheme of the debugger by a
16 bit memory space identifier. You should activate the option first, and then load the symbols.

SYStem.Option GDBEXTENDED

Format:

Enable/disable gdb extended mode

SYStem.Option GDBEXTENDED ON | OFF

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

11

GDB Front-end Commands

SYStem.Option GDBNONSTOP

Format:

Enable/disable non-stop mode

SYStem.Option GDBNONSTOP ON | OFF

SYStem.PORT

Set communication settings

Format:

SYStem.PORT <settings>

<settings>:

COM1 BAUD=9600
HOST:PORT

Set the communication parameters. You can use a serial or a TCP communication.
SYStem.PORT COM1 baud=9600
SYStem.PORT 10.1.2.99:2345

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

12

GDB Front-end Commands

SYStem.GDBFILE

Format:

Set the name of the debugged application

SYStem.GDBFILE <name> (deprecated)

SYStem.GDBLibPath

Format:

Set the path to the target libraries on the host

SYStem.GDBLibPath <path> (deprecated)

SYStem.GDBSIGnal

Define signal handling

Format:

SYStem.GDBSIGnal <mode> <signum>

<mode>:

STOP | NOSTOP | PASS | NOPASS | PRINT | NOPRINT

<signum>:

signal number

This command define the gdbserver/TRACE32 behavior when the application sends the signal signum.

STOP

The debugger should stop on this signal.

NOSTOP

The signal is ignored and the application continue running.

PASS

Allow the program to see this signal; the program can handle the signal, or
else it may terminate if the signal is fatal and not handled.

NOPASS

Do not allow the program to see this signal.

PRINT

A message is printed in the area window when the signal is received.

NOPRINT

No message is printed.

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

13

GDB Front-end Commands

TASK.List

Format:

List the running processes on the target

TASK.List

Only for multi-process mode.

TASK.SELect

Format:

Select a task for debugging

TASK.SELect <id>

Only for multi-process mode.

TASK.RUN

Format:

Start a new process

TASK.RUN <process>

Only for multi-process mode.

TASK.KILL

Format:

Kill a running process

TASK.KILL <id>

Only for multi-process mode.

TASK.Attach

Format:

Attach to a running process

TASK.Attach <pid>

Only for multi-process mode.

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

14

GDB Front-end Commands

TASK.DETACH

Format:

Detach from a a running process

TASK.DETACH <pid>

Only for multi-process mode.

TASK.COPYUP

Format:

Copy a file from the target into the host

TASK.COPYUP <targetfile> <file>

TASK.COPYDOWN

Format:

Copy a file from the host into the target

TASK.COPYDOWN <file> <targetfile>

TASK.Go

Format:

Start a single task

TASK.Go <id>

Only for multi-process mode.

TASK.Break

Format:

Stop a single task

TASK.Break <id>

Only for multi-process mode.

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

15

GDB Front-end Commands

Support

Compiler
ARM
Language

Compiler

C
C
C
C
C

CARM
ARMCC
ARMCC
REALVIEW-MDK
GCCARM

C
C
C
C
C
C
C
C
C++
C++
C++
C++
C++
C++
C++
C++
C/C++
C/C++
C/C++

Company

ARM Germany GmbH


ARM Ltd.
ARM Ltd.
ARM Ltd.
Free Software
Foundation, Inc.
GCCARM
Free Software
Foundation, Inc.
GREENHILLS-C
Greenhills Software Inc.
ICCARM
IAR Systems AB
ICCV7-ARM
Imagecraft Creations
Inc.
HIGH-C
Synopsys, Inc
TI-C
Texas Instruments
GNU-C
Wind River Systems
D-CC
Wind River Systems
ARM-SDT-2.50
ARM Ltd.
REALVIEW-MDK
ARM Ltd.
GCCARM
Free Software
Foundation, Inc.
GNU
Free Software
Foundation, Inc.
GCCARM
Free Software
Foundation, Inc.
GREENHILLS-C++ Greenhills Software Inc.
MSVC
Microsoft Corporation
HIGH-C++
Synopsys, Inc
XCODE
Apple Inc.
GCC
HighTec EDV-Systeme
GmbH
VX-ARM
TASKING

Option

Comment

ELF/DWARF
AIF
ELF/DWARF
ELF/DWARF2
COFF/STABS
ELF/DWARF2
ELF/DWARF2
ELF/DWARF2
ELF/DWARF ARM7
ELF/DWARF
COFF
COFF
ELF
ELF/DWARF2
ELF/DWARF2
COFF/STABS
EXE/STABS
ELF/DWARF2
ELF/DWARF2
EXE/CV5
WindowsCE
ELF/DWARF
Mach-O
ELF/DWARF
ELF/DWARF2

I386

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

16

Support

Language

Compiler

Company

Option

GNU-C

DBX

GNU-C

C
C
C
C

GCC386
IC386
IC286
MCC386

C
C
C
C
C
C
C
C++

MSVC-1.5
MSVC
MSVC
MSVC/CSI
SCO-UNIX-CC
HC386
HIGHC
BORLAND-C

C++

ORGANON

C++

GNU-C++

C++
C++
C++

MSVC
HC386
HIGH-C++

Free Software
Foundation, Inc.
Free Software
Foundation, Inc.
Greenhills Software Inc.
Intel Corporation
Intel Corporation
Mentor Graphics
Corporation
Microsoft Corporation
Microsoft Corporation
Microsoft Corporation
Microsoft Corporation
SCO
Synopsys, Inc
Synopsys, Inc
Borland Software
Corporation
CAD-UL
ElectronicServices
GmbH
Free Software
Foundation, Inc.
Microsoft Corporation
Synopsys, Inc
Synopsys, Inc

Language

Compiler

Company

Option

C
C++
C++

TCC
SDE
GCC

IEEE
ELF/STABS
ELF/DWARF

C++

GREEN-HILLSC++

TASKING
Algorithmics
Free Software
Foundation, Inc.
Greenhills Software Inc.

Comment

ELF/DWARF2
COFF
OMF-386
OMF-286
EOMF-386
EOMF-386
Pharlap ETS
EXE/CV
OMF-386/CV SSI Link386
EOMF-386
COFF
OMF386/SPF
ELF/DWARF
EXE/BC5
OMF386++

DBX
EXE/CV4
OMF/SPF
ELF/DWARF

MIPS
Comment

ELF/DWARF

PPC

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

17

Support

Language

Compiler

Company

Option

ADA

GNAT

ELF/DWARF

C
C

CXPPC
XCC-V

C
C

GREEN-HILLS-C
MCCPPC

C
C
C
C
C
C
C
C++

CC
ULTRA-C
HIGH-C
DCPPC
D-CC
D-CC
D-CC
GCC

C++
C++

GREEN-HILLSC++
CCCPPC

Free Software
Foundation, Inc.
Cosmic Software
GAIO Technology Co.,
Ltd.
Greenhills Software Inc.
Mentor Graphics
Corporation
NXP Semiconductors
Radisys Inc.
Synopsys, Inc
TASKING
Wind River Systems
Wind River Systems
Wind River Systems
Free Software
Foundation, Inc.
Greenhills Software Inc.

C++
C++
C++
C++
C/C++

MSVC
HIGH-C++
D-C++
GCCPPC
GCC

C/C++
GCC

CODEWARRIOR
GCC

JAVA

FASTJ

Mentor Graphics
Corporation
Microsoft Corporation
Synopsys, Inc
Wind River Systems
Wind River Systems
HighTec EDV-Systeme
GmbH
NXP Semiconductors
Free Software
Foundation, Inc.
Wind River Systems

Language

Compiler

Company

Option

C
C
C

ARMCC
ARMCC
GCCARM

AIF
ELF/DWARF
COFF/STABS

GCCARM

C
C

GREENHILLS-C
ICCARM

ARM Ltd.
ARM Ltd.
Free Software
Foundation, Inc.
Free Software
Foundation, Inc.
Greenhills Software Inc.
IAR Systems AB

Comment

ELF/DWARF
SAUF
ELF/DWARF
ELF/DWARF
XCOFF
ROF
ELF/DWARF
ELF/DWARF
IEEE
COFF
ELF/DWARF
ELF/DWARF
ELF/DWARF
ELF/DWARF
EXE/CV5
ELF/DWARF
ELF/DWARF
ELF/STABS
ELF/DWARF

WindowsCE

ELF/DWARF
ELF/DWARF
ELF/DWARF

XScale
Comment

ELF/DWARF2
ELF/DWARF2
ELF/DWARF2

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

18

Support

Language

Compiler

C
C
C
C++
C++

HIGH-C
TI-C
GNU-C
ARM-SDT-2.50
GCCARM

C++
C++
C++
C++
C++
C/C++

Company

Synopsys, Inc
Texas Instruments
Wind River Systems
ARM Ltd.
Free Software
Foundation, Inc.
GNU
Free Software
Foundation, Inc.
GCCARM
Free Software
Foundation, Inc.
GREENHILLS-C++ Greenhills Software Inc.
MSVC
Microsoft Corporation
HIGH-C++
Synopsys, Inc
VX-ARM
TASKING

Option

Comment

ELF/DWARF
COFF
COFF
ELF/DWARF2
COFF/STABS
EXE/STABS
ELF/DWARF2
ELF/DWARF2
EXE/CV5
WindowsCE
ELF/DWARF
ELF/DWARF2

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

19

Support

Products

Product Information
OrderNo Code

Text

LA-3741

JTAG Debugger for Hexagon Core (ICD)

JTAG-HEXAGON

supports Hexagon from Qualcomm


Multicore debugging included
includes software for Windows, Linux and MacOSX
requires Power Debug Module or PowerTrace
debug cable with 20 pin connector

LA-3741A

JTAG Debugger License for Hexagon Add.

JTAG-HEXAGON-A

supports Hexagon
Multicore debugging included
Extension applicable to the following debug cables
(purchased separately):
for LA-3743 (JTAG Debugger for Cortex-A5x)
for LA-7746 (JTAG Debugger for ARM7)
for LA-7742 (JTAG Debugger for ARM9)
for LA-7744 (JTAG Debugger for ARM10)
for LA-7765 (JTAG Debugger for ARM11)
for LA-7843 (JTAG Debugger for Cortex-A/-R (ARMv7))
for LA-7844 (JTAG Debugger for Cortex-M)
please add the serial number of the base dongle
to your order

LA-8897D

TRACE32 Front-End Hexagon (Dongle)

FRONTEND-HEXAGON-UD

TRACE32 Front-End connecting to


- virtual prototypes/simulators (VAST, CoWare ...)
- third-party target server (GDB server ...)
supports the Hexagon architecture
licensed for one host system via USB dongle
for Windows32, Windows64, Linux32, Linux64
and MAC OS X

LA-8897L

1 User Floating License Hexagon Front-End

FRONTEND-HEXAGON-FL

TRACE32 Front-End connecting to


- virtual prototypes/simulators (VAST, CoWare ...)
- third-party target server (GDB server ...)
supports the Hexagon architecture
for Windows32, Windows64, Linux32, Linux64
and Solaris, other platforms on request
floating license via RLM (Reprise License Manager)
Please add the RLM HostID of the license server
to your order (please see our FAQ)

Order Information
Order No.

Code

Text

LA-3741
LA-3741A
LA-8897D

JTAG-HEXAGON
JTAG-HEXAGON-A
FRONTEND-HEXAGON-UD

JTAG Debugger for Hexagon Core (ICD)


JTAG Debugger License for Hexagon Add.
TRACE32 Front-End Hexagon (Dongle)

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

20

Products

Order No.

Code

Text

LA-8897L

FRONTEND-HEXAGON-FL

1 User Floating License Hexagon Front-End

Additional Options
LA-7765A JTAG-ARM11-A
LA-7746A JTAG-ARM7-A
LA-7742A JTAG-ARM9-A
LA-3743A JTAG-ARMV8-A-A
LA-7843A JTAG-CORTEX-A/R-A
LA-7844A JTAG-CORTEX_M-A

JTAG Debugger License for ARM11 Add.


JTAG Debugger License for ARM7 Add.
JTAG Debugger License for ARM9 Add.
JTAG Debugger License for Cortex-A5x Add.
JTAG Debugger License for Cortex-A/-R Add.
JTAG Debugger License for Cortex-M Add.

1989-2016 Lauterbach GmbH

TRACE32 as GDB Front-End

21

Products

You might also like