
GRMON3-UM
June 2019, Version 3.1.0
24
www.cobham.com/gaisler
3.6.1. Multi-processor symbolic debug information
When loading symbols into GRMON it is possible to associate them with a CPU. When all symbols/images are
associated with CPU index 0, then GRMON will assume its a single-core or SMP application and lookup all
symbols from the symbols table associated with CPU index 0.
If different CPU indexes are specified (by setting active CPU or adding cpu# argument to the commands) when
loading symbols/images, then GRMON will assume its an AMP application that has been loaded. GRMON will
use the current active CPU (or cpu# argument) to determine which CPU index to lookup symbols from.
grmon3> cpu active 1
grmon3> symbols ../tests/threads/rtems-mp2
Loaded 1630 symbols
grmon3> bp _Thread_Handler
Software breakpoint 1 at <_Thread_Handler>
grmon3> symbols ../tests/threads/rtems-mp1 cpu0
Loaded 1630 symbols
grmon3> bp _Thread_Handler cpu0
Software breakpoint 2 at <_Thread_Handler>
grmon3> bp
NUM ADRESS MASK TYPE CPU SYMBOL
1 : 0x40418408 (soft) 1 _Thread_0
2 : 0x40019408 (soft) 0 _Thread_0
3.7. GDB interface
This section describes the GDB interface support available in GRMON. GRMON supports GDB version 6.3, 6.4,
6.8 and 8.2. Other tools that communicate over the GDB protocol may also attach to GRMON, some tools such
as Eclipse Workbench and DDD communicate with GRMON via GDB.
GDB must be built for the SPARC architecture, a native PC GDB does not work together with GRMON. The
toolchains that Cobham Gaisler distributes comes with a patched and tested version of GDB targeting all SPARC
LEON development tools.
Please see the GDB documentation available from the official GDB homepage [http://www.gnu.org/soft-
ware/gdb/].
3.7.1. Connecting GDB to GRMON
GRMON can act as a remote target for GDB, allowing symbolic debugging of target applications. To initiate GDB
communications, start the monitor with the
-gdb
switch or use the GRMON gdb start command:
$ grmon -gdb
...
Started GDB service on port 2222.
...
grmon3> gdb status
GDB Service is waiting for incoming connection
Port: 2222
Then, start GDB in a different window and connect to GRMON using the extended-remote protocol. By default,
GRMON listens on port 2222 for the GDB connection:
$ sparc-gaisler-elf-gdb /opt/bcc-2.0.7-rc.1-gcc/src/examples/stanford/stanford
GNU gdb (GDB) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=sparc-gaisler-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.