Go to the first, previous, next, last section, table of contents.

Debugging on MIPS targets

GDB needs to know these things to talk to your MIPS:

  1. what serial device connects your host to your MIPS board (the first serial device available on your host is the default).
  2. what speed to use over the serial device.

mips-idt-ecoff-gdb uses the MIPS remote serial protocol to connect your development host machine to the target board. On the target board itself, the IDT program IDT/sim implements the same protocol. (IDT/sim runs automatically whenever the board is powered up.)

Use these GDB commands to specify the connection to your target board:

target mips port
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. 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$ mips-idt-ecoff-gdb prog
GDB is free software and ...
(gdb) target mips /dev/ttyb
...
(gdb) load
...
(gdb) run
target mips hostname:portnumber
You can specify a TCP/IP connection instead of a serial port, using the syntax hostname:portnumber (assuming your IDT board is connected so that this makes sense; for instance, to a serial line managed by a terminal concentrator).

GDB also supports these special commands for IDT/MIPS targets:

set mipsfpu off
If your target board does not support the MIPS floating point coprocessor, you should use the command `set mipsfpu off' (you may wish to put this 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 neglect to do this, calls into your program, such as `print strlen("abc")', will fail.
set remotedebug n
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 will be displayed. If you set it to 2 every character will be displayed. You can check the current value at any time with the command `show remotedebug'.


Go to the first, previous, next, last section, table of contents.