(This tutorial / "walkthrough" assumes at least a basic familiarity with compiling programs using GNU autoconf and with using GDB to get backtraces for crashes. If you have no experience in this error, feel free to follow along anyway, if you're curious; if you run into problems, go and find a real GDB tutorial and come back to this; if you still have trouble, I can help you. For those seasoned developers out there, I'd welcome suggestions for a better approach to debugging this issue.)
On OS X 10.5, gcc now uses something known as "DWARF" debugging symbols. I was unable to find a good, succinct summary of what that means, but I'll try to explain by example.
I've been trying to debug the Gimp crash seen by Michael Thorn, and others. The symptom is that if you run Gimp 2.4rc3, create a blank canvas, and click and drag to draw a black paintstroke, it will often crash.
$ open GIMP-2.4-rc3-intel.dmg
At this point, I recommend you open up two Terminal windows -- one in which to run Gimp (so you can see console output), and the other to eventually run gdb.
$ /Volumes/GIMP/Gimp.app/Contents/Resources/bin/gimp
You'll see many error messages scroll by while Gimp starts; these are "harmless", or at least don't seem to pertain to the issue at hand.
Once Gimp starts, go to File, New, click OK, click on the canvas, and drag. CRASH
You'll see this in the Terminal window:
The program 'gimp-2.4' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 57392 error_code 3 request_code 39 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
Okay, let's do what it's asking us to do.