Building a newer version of gdb for ppc405 on top of Hardhat Linux 2.0 Approximate directions - please send corrections to dank@kegel.com See also http://www.kegel.com/linux/gdbserver.html 1) The latest release of gdb, 5.3, has multithread support in gdbserver. Download the source from e.g. ftp://sources.redhat.com/pub/gdb/releases/gdb-5.3.tar.bz2 Unpack it: tar -xjvf ../gdb-5.3.tar.bz2 2) Configure and build a local version. I had to pass --enable-sim-hostendian=little to fix a build error in sim/ppc on my little-endian build machine, and --with-solib-absolute-prefix to match Hardhat's directory structure. (I also had to create the patch that added that option; the patch is at http://sources.redhat.com/ml/gdb/2002-07/msg00155.html if you want to apply it. I thought that was accepted, but it doesn't seem to be in gdb-5.3.) mkdir ppc405 cd ppc405 /bin/sh ../gdb-5.3/configure --target=powerpc-linux \ --enable-sim-hostendian=little \ --with-solib-absolute-prefix=/opt/hardhat/devkit/ppc/405/target make # Grab the gdb that created (perhaps using "make install")... cd .. 3) Configure and build gdbserver for the ppc405. mkdir cross-ppc405 cd cross-ppc405 export CC=/opt/hardhat/devkit/ppc/405/bin/ppc_405-gcc export CFLAGS="-mcpu=403 -D__PPC405__" export ac_cv_func_mmap_fixed_mapped=yes /bin/sh ../gdb-5.3/gdb/gdbserver/configure powerpc-linux make # Grab the gdbserver that created (perhaps using "make install")... 4) Transfer gdbserver to the target system, telnet there, and run your program with gdbserver foo:1234 programname This tells it to listen on port 1234 for a connection from gdb. (The 'foo:' is required but ignored.) 5) On your development system, run gdb with gdb programname (Optional) If you want to step into shared libraries explicitly loaded by your program with dlopen at runtime, tell gdb where to find them with a command like set solib-search-path /home/dank/ppc405/staging/fsimg/usr/lib Tell gdb to connect to the remote gdbserver: target remote 10.0.1.1:1234 Then set a breakpoint, e.g. break main and continue execution: cont