Getting started xSYM4gdb with a CFM program:


CodeWarrior setup:

CW9: compile a simple CFM program with First create a simple CFM program.
Be sure that the "Generate SYM File" and "Full Path in SYM Files" checkboxes in the PPC Linker's are enabled.

Command line debugging:

Set the environment variables: The environment variable GDB_CFM_XSYM_PATH should contain the list of directories where gdb will look for xSYM files. Example of setting up this path:
export GDB_CFM_XSYM_PATH=/Volumes/Work/MyCFMApp/:/Volumes/Work/MyCFMLibrary/

Start the CFM app from gdb as follows:
xsym4gdb /Volumes/Work/MyCFMApp/MyCFMApp

Now GDB should load the MyCFMApp.xSYM file for your app. You can press ctrl+c to stop the app, and you should be able to get a stacktrace with the where command. This stacktrace should contain sourcecodeline information.

XCode Integration:

You can use XCode IDE to debug your CFM executable, by doing the following:
  1. Set the xsym4gdb the default gdb command by running:
    (Warning: xsym4gdb might containg bugs as this is based on the beta gdb from Tiger, you can switch back to regular gdb with xsym4gdb_select apple)
    sudo xsym4gdb_select xsy
  2. Select the "New Custom Executable" item from the "Project" menu.
  3. Set the "Exectuable path:" to "/System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp"!
  4. Press the info button for the created executable. In the "Arguments" tab page add the path to your CFM application.
    (Eg.: /Volumes/WorkHD/MyCFMDir/MyCFMApp)
  5. In the Variables section of the "Arguments" tab page, add a new variable named "GDB_CFM_XSYM_PATH". With a directory name containing your .xSYM files for the CFM application.
To test select the created executable, and select the "Debug Excetuable" command  from the "Debug" menu.