SourceForge.net Logo

GDB for CodeWarrior

Important note for 10.4.2, 10.4.6 users

GDB for CW and 10.4.2, 10.4.6 is currently not compatible (10.4.3, 10.4.4, 10.4.5 works fine). If you try to debuyg a program you'll get a process already staring message during the debugging. Workarounds
  1. Install XCode again. (This will override gdb4cw...)
  2. Disable gdb4cw with:
    sudo gdb4cw_select apple
    
  3. # Warning: the following might demage your system if not done correctly
    # Warning: this will probably disable the ability to use 64-bit programs 
    # on a G5
    # You can restore original with: sudo cp /usr/lib/dyld.orig /usr/lib/dyld
    # 1. Make a backup:
    sudo cp /usr/lib/dyld /usr/lib/dyld.orig
    # 2. extract the ppc verson to a different file
    sudo lipo -extract ppc /usr/lib/dyld -output /usr/lib/dyld.ppc
    # 3. replace with the ppc only version
    sudo cp /usr/lib/dyld.ppc /usr/lib/dyld
    

GDB with modifications for CodeWarrior users:

GDB4CW is a modified version of apple's gdb, with improvements for codewarrior users.
Currentry GDB4CW has the following modifications compared to Apple original gdb:
  1. Allows debugging of program linked with DATA before TEXT segment option.
  2. Speed improvements mostly affecting startup times of apps. With large applications and lot of plugins loading/unloading at startup time GDB4CW can be about 2x faster than original one.
The 1.0 version of gdb4cw was created from gdb 309. (XCode1.2) In my experience this gdb release was the most stable from CodeWarrior standpoint. (I've tested XCode 1.5, 2.0, 2.1 and 2.2 beta's gdb-s.)

Using gdb4cw:

Gdb4cw comes with an installer. All you have to do is installing it.
gdb4cw doesn't removes your gdb installation. At any time you can swith back to the original gdb with the following command:
sudo gdb4cw_select apple

Downloads:

gdb4cw 1.0.1 disk image (based on gdb 309)

list of changes to Apple's gdb
source code via cvs (get the GDB4CW_53 branch)