21.3.5 MIPS Embedded
Use these gdb commands to specify the connection to your target board:
- To run a program on the board, start up
gdbwith the name of your program as the argument. To connect to the board, use the command target mips port, where port is the name of the serial port connected to the board. If the program has not already been downloaded to the board, you may use the
loadcommand to download it. You can then use all the usual gdb commands.
For example, this sequence connects to the target board through a serial port, and loads and runs a program called prog through the debugger:
host$ gdb prog gdb is free software and ... (gdb) target mips /dev/ttyb (gdb) load prog (gdb) run
- On some gdb host configurations, you can specify a TCP
connection (for instance, to a serial line managed by a terminal
concentrator) instead of a serial port, using the syntax
- PMON ROM monitor.
- NEC's DDB variant of PMON for Vr4300.
- LSI variant of PMON.
- Densan DVE-R3900 ROM monitor for Toshiba R3900 Mips.
- Array Tech LSI33K RAID controller board.
gdb also supports these special commands for MIPS targets:
set mipsfpu double
set mipsfpu single
set mipsfpu none
set mipsfpu auto
- If your target board does not support the MIPS floating point
coprocessor, you should use the command set mipsfpu none (if you
need this, you may wish to put the command in your gdb init
file). This tells gdb how to find the return value of
functions which return floating point values. It also allows
gdb to avoid saving the floating point registers when calling
functions on the board. If you are using a floating point coprocessor
with only single precision floating point support, as on the r4650
processor, use the command set mipsfpu single. The default
double precision floating point coprocessor may be selected using
set mipsfpu double.
In previous versions the only choices were double precision or no floating point, so set mipsfpu on will select double precision and set mipsfpu off will select no floating point.
As usual, you can inquire about the
mipsfpuvariable with show mipsfpu.
- You can control the timeout used while waiting for a packet, in the MIPS
remote protocol, with the
set timeoutseconds command. The default is 5 seconds. Similarly, you can control the timeout used while waiting for an acknowledgment of a packet with the
set retransmit-timeoutseconds command. The default is 3 seconds. You can inspect both values with
show retransmit-timeout. (These commands are only available when gdb is configured for --target=mips-idt-ecoff.)
The timeout set by
set timeoutdoes not apply when gdb is waiting for your program to stop. In that case, gdb waits forever because it has no way of knowing how long the program is going to run before stopping.
- Limit the maximum number of characters gdb should ignore when
it tries to synchronize with the remote target. The default is 10
characters. Setting the limit to -1 means there's no limit.
- Show the current limit on the number of characters to ignore when
trying to synchronize with the remote system.
- Tell gdb to expect the specified prompt string from the
remote monitor. The default depends on the target:
- pmon target
- ddb target
- lsi target
- Show the current strings gdb expects as the prompt from the
- Enable or disable monitor warnings about hardware breakpoints. This
has effect only for the
lsitarget. When on, gdb will display warning messages whose codes are returned by the
lsiPMON monitor for breakpoint commands.
- Show the current setting of printing monitor warnings.
- This command allows sending an arbitrary command string to the monitor. The monitor must be in debug mode for this to work.