f78
GDB and remote MIPS boards
This is available when you configure GDB with
Use the following GDB commands to specify the connection to your target board.
For example, the following sequence connects to the target board through a
serial port, and loads and runs a program called
target mips hostname:portnumber
GDB also supports the following special commands for MIPS targets.
show processor
set mipsfpu single
set mipsfpu none
show mipsfpu
In previous versions the only choices were double precision or no floating
point, so ‘
show remotedebug
set retransmit-timeout seconds
show timeout
show retransmit-timeout
Note: These commands are available only when GDB is configured for ‘
The timeout set by
To run a program on the board, start up gdb with 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 load command to download it. You can then use all the usual GDB commands.
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 ‘hostname:portnumber’.
Use the set processor command to set the type of MIPS processor when you want to access
processor-type-specific registers. For example, set processor r3041 tells GDB to use the CPO registers appropriate for the 3041 chip. Use the show processor command to see what MIPS processor GDB is using. Use the info reg command to see what registers GDB is using.
If your target board does not support the MIPS floating point coprocessor, you
should use the command ‘
ff5
set mipsfpu none’ (if you need this, you may wish to put the command in your .gdbinit 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’.
You can see some debugging information about communications with the board by
setting the remotedebug variable. If you set it to 1 using ‘set remotedebug 1’, every packet is displayed. If you set it to 2, every character is displayed. You can check the current value at any time
with the command, show remotedebug.
You can control the timeout used while waiting for a packet, in the MIPS
remote protocol, with the set timeout seconds command. The default is 5 seconds. Similarly, you can control the timeout
used while waiting for an acknowledgement of a packet with the set retransmit-timeout seconds command. The default is 3 seconds. You can inspect both values with show timeout and show retransmit-timeout.