f78 Debugging on mips targets Contents|Index|Previous|Next
 

Debugging on MIPS targets 

The folllowing documentation discusses debugging with MIPS.

gdb needs to know the following things to talk to your MIPS target.

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 one of the following gdb commands to specify the connection to your target board.

Linking MIPS with the GOFAST library

The GOFAST library is available with two interfaces; gcc -msoft-float output places all arguments in registers, which (for subroutines using double arguments) is compatible with the interface identified as “Interface 1: all arguments in registers” in the GOFAST documentation. For full compatibility with all GOFAST subroutines, you need to make a slight modification to some of the subroutines in the GOFAST library.

If you purchase and install the GOFAST library, you can link your code to that library in a number of different ways, depending on where and how you install the library. To focus on the issue of linking, the following examples assume you’ve already built object modules with appropriate options (including -msoft-float).

This is the simplest case; it assumes that you’ve installed the GOFAST library as the file, fp.a, in the same directory where you do development, as shown in the GOFAST documentation.

In a shared development environment, the following example may be more realistic; it assumes you’ve installed the GOFAST library as
uss-dir/libgofast.a’, where ‘ussdir’ is any convenient directory on your development system. Finally, you can eliminate the need for a -L option with a little more setup, using an environment variable like the following example (the example assumes you use a command shell compatible with the Bourne shell): As for the previous example, the GOFAST library is installed in the directory, uss-dir/libgofast.a. The environment variable, LIBRARY_PATH, instructs GCC to look for the library in ussdir. (The syntax shown here for setting the environment variable is the Unix Bourne Shell, /bin/sh, syntax; adjust as needed for your system.)

Notice that all the variations on linking with the GOFAST library explicitly include -lc before the GOFAST library. -lc is the standard C subroutine library; normally, you don’t have to specify this subroutine, since linking with the GOFAST library is automatic.

When you link with an alternate software floating-point library, however, the order of linking is important. In this situation, specify ‘-lc’ to the left of the GOFAST library, to ensure that standard library subroutines also use the GOFAST floating-point code.

Full compatibility with the GOFAST library for MIPS

The GCC calling convention for functions whose first and second arguments have type float is not completely compatible with the definitions of those functions in the GOFAST library, as shipped. The following functions are affected.

    fpcmp        fpadd        fpsub 
    fpmul        fpdiv        fpfmod 
    fpacos       fpasin       fpatan 
    fpatan2      fppow
Since the GOFAST library is normally shipped with source, you can make these functions compatible with the gcc convention by adding the following instruction to the beginning of each affected function, then rebuilding the library. 0