
GRMON3-UM
June 2019, Version 3.1.0
27
www.cobham.com/gaisler
(gdb) target extended-remote :2222
Remote debugging using :2222
(gdb) set remote exec-file /opt/rtems-4.10/src/samples/rtems-mp1
(gdb) mon stack 0x403fff00 cpu0
CPU 0 stack pointer: 0x403fff00
(gdb) mon load /opt/rtems-4.10/src/samples/rtems-mp2 cpu1
Total size: 177.33kB (1.17Mbit/s)
Entry point 0x40400000
Image /opt/rtems-4.10/src/samples/rtems-mp2 loaded
(gdb) mon stack 0x407fff00 cpu1
CPU 1 stack pointer: 0x407fff00
(gdb) run
Starting program: /opt/rtems-4.10/src/samples/rtems-mp1
NODE[0]: is Up!
NODE[0]: Waiting for Semaphore A to be created (0x53454d41)
NODE[0]: Waiting for Semaphore B to be created (0x53454d42)
NODE[0]: Waiting for Task A to be created (0x54534b41)
^C[New Thread 151060481]
Program received signal SIGINT, Interrupt.
[Switching to Thread 151060481]
pwdloop () at /opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/leon3/startup/bspidle.S:26
warning: Source file is more recent than executable.
26 retl
Current language: auto; currently asm
(gdb)
If the executable is not available on the remote computer where GRMON is running, then the GDB command file
and load can be used to load the software to the target system. Use the GRMON command cpu act <num> before
issuing the GDB command load to specify which CPU is the target for the software being loaded. In addition the
stacks must also be set manually in GRMON using the command stack <address> cpu# for both CPUs.
$ sparc-rtems-gdb
GNU gdb 6.8.0.20090916-cvs
Copyright (C) 2008 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=i686-pc-linux-gnu --target=sparc-rtems".
(gdb) target extended-remote :2222
Remote debugging using :2222
0x40000000 in ?? ()
(gdb) file /opt/rtems-4.10/src/samples/rtems-mp2
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from /opt/rtems-4.10/src/samples/rtems-mp2...done.
(gdb) mon cpu act 1
(gdb) load
Loading section .text, size 0x2b3e0 lma 0x40400000
Loading section .data, size 0x1170 lma 0x4042b3e0
Loading section .jcr, size 0x4 lma 0x4042c550
Start address 0x40400000, load size 181588
Transfer rate: 115 KB/sec, 759 bytes/write.
(gdb) file /opt/rtems-4.10/src/samples/rtems-mp1
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Load new symbol table from "/opt/rtems-4.10/src/samples/rtems-mp1"? (y or n) y
Reading symbols from /opt/rtems-4.10/src/samples/rtems-mp1...done.
(gdb) mon cpu act 0
(gdb) load
Loading section .text, size 0x2b3e0 lma 0x40001000
Loading section .data, size 0x1170 lma 0x4002c3e0
Loading section .jcr, size 0x4 lma 0x4002d550
Start address 0x40001000, load size 181588
Transfer rate: 117 KB/sec, 759 bytes/write.
(gdb) mon stack 0x407fff00 cpu1
CPU 1 stack pointer: 0x407fff00
(gdb) mon stack 0x403fff00 cpu0
CPU 0 stack pointer: 0x403fff00
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /opt/rtems-4.10/src/samples/samples/rtems-mp1
3.7.6. GDB Thread support
GDB is capable of listing a operating system's threads, however it relies on GRMON to implement low-level
thread access. GDB normally fetches the threading information on every stop, for example after a breakpoint is