New: In most cases it is no longer necessary to build a special version of gdb for use with Systemsim. Only the PowerPC 750 versions of Systemsim require a modified gdb.
% wget ftp://sources.redhat.com/pub/gdb/releases/gdb-6.3.tar.gz
% tar -zxvf gdb-6.3.tar.gz
% cd gdb-6.3
% patch -p1 < systemsim_gdb-6.3.diff
--prefix {directory}
to install somewhere else, e.g., /opt/ppc32-tools.
% ./configure --prefix /opt/ppc32-tools --target=powerpc-ibm-eabi --disable-nls --disable-tui \
--disable-gdbtk --disable-profiling --disable-sim
% make all
% su
% make install
Note: If you wish to use a different debugger, like DDD, that just uses the CLI version of gdb,
you should tell DDD to use the actual gdb program file in /opt/ppc32-tools/bin.
The main change to GDB is to enable it to handle the full set of system registers for the PowerPC 750. In the modified version of gdb, you enable this feature with the set architecture command:
(gdb) set architecture powerpc:750
Once you set up the architecture you may now use the standard remote method. First, tell Systemsim to connect to gdb with the command:
systemsim% mysim debugger wait 0
Systemsim will print the port number it is using for the GDB connection.
Then, in GDB:
(gdb) target remote :<port>
It is possible to send tcl commands to systemsim from GDB. The output will appear on the systemsim console as if it was typed there. This command is:
(gdb) monitor <tcl command>