The gdb-remote module allows a GDB session to connect to Simics and control the execution. An object of class gdb-remote is used to accept incoming GDB connection requests.
A GDB binary capable of debugging many Simics target machines is included in the Simics Base package. If you want to build your own gdb, read on.
The following table lists, for each target architectures supported by gdb-remote, the string to give to configure as the --target parameter when building GDB, and any command you may have to enter at the GDB command prompt before connecting to Simics:
- ppc64
- --target powerpc64-elf-linux
command: set architecture powerpc:common64 - risc-v64
- --target riscv64-linux-gnu
command: set architecture riscv - h8300
- --target h8300-elf
command: set architecture h8300(s|h) - x86-64
- --target x86_64-pc-linux-gnu
command: set architecture i386:x86-64 - mips64be
- --target mips64-elf64-linux64
command: set architecture mips:isa64r2 - arc600
- --target arc-elf32
command: set architecture opella-target arc600 - arm64
- --target aarch64-elf
- sparc-v8
- --target sparc-unknown-linux-gnu
command: set architecture sparc:v8plus - mips64le
- --target mips64el-elf64-linux64
command: set architecture mips:isa64r2 - ppce500
- --target powerpc64-elf-linux
command: set architecture powerpc:e500 - ppc32
- --target powerpc64-elf-linux
command: set architecture powerpc:common - x86
- --target x86_64-pc-linux-gnu
command: set architecture i386 - armle
- --target armle-unknown-linux-gnu
- risc-v32
- command: set architecture riscv:rv32
- xtensa
- --target xtensa
command: set architecture xtensa - arc700
- --target arc-elf32
command: set architecture ARC700 - armbe
- --target armbe-unknown-linux-gnu
- mips32le
- --target mips-elf-linux
command: set architecture mips:isa32r2 - mips32be
- --target mips-elf-linux
command: set architecture mips:isa32r2 - nios2
- --target nios2-elf
- m68k
- --target m68k
command: set architecture m68k
Note that these --target flags are not the only ones that will work, just examples of ones that do work.
conf_object, log_object, external_connection_events
- cell-change
- Notifier that is triggered after the object's cell was changed.
- object-delete
- Notifier that is triggered just before Simics object is deleted.
- queue-change
- Notifier that is triggered after the object's clock was changed. New clock can be obtained with the SIM_object_clock function.
- tcp
-
tcp-server
– gdb-remote TCP server
- unix_socket
-
unix-socket-server
– gdb-remote Unix domain socket server
-
disconnect
– disconnect from the remote gdb
-
follow-context
– deprecated follow context
-
info
– print information about the object
-
signal
– tell remote gdb we got a signal
-
target
– set target CPU for gdb connection
-
use_ipv4
-
Pseudo attribute;
read/write access; type:
b
Determines if connections should be restricted to IPv4. Default is FALSE
-
listen
-
Pseudo attribute;
read/write access; type:
i
Set to start listening for incoming GDB connections on the specified port. If 0 is specified, an arbitrary available port will be used. Read to get the port currently listened on, or 0 if none.
-
processor
-
Pseudo attribute;
read/write access; type:
o|n
Processor to connect the GDB stub to.
-
architecture
-
Pseudo attribute;
read/write access; type:
s
Architecture of target.
-
disconnect
-
Pseudo attribute;
write-only access; type:
b
Disconnects the remote GDB
-
connected
-
Pseudo attribute;
read-only access; type:
b
Returns true if the gdb-remote object is connected to a GDB session, false if not.
-
signal
-
Pseudo attribute;
write-only access; type:
i
Sends a signal to the remote GDB. This makes GDB think the program it is debugging has received a signal. See the signal(7) man page for a list of signal numbers.
-
send_packet
-
Pseudo attribute;
write-only access; type:
s
Sends a raw packet from gdb-remote to GDB. The string that this attribute is written with will be sent as a packet to GDB.
-
large_operations
-
Optional attribute;
read/write access; type:
i
Set to non-zero if memory operations received from GDB should be performed as single operations instead of bytewise
-
follow_context
-
Pseudo attribute;
read/write access; type:
i
Set to non-zero if context should be followed.
-
context_object
-
Optional attribute;
read/write access; type:
o|n
Context object that this GDB session is attached to.
-
send_target_xml
-
Optional attribute;
read/write access; type:
b
Should an XML target description be sent to GDB, default is true, but can be disabled since it can confuse some clients.
gdb-remote