tags:

views:

1004

answers:

4

I've been programming on the Mac since I was a little kid using THINK C. I've never had to use a debugger as bad as the one that comes with XCode.

  • It's unresponsive, and bogs down further and becomes unstable when watching more variables.
  • When it crashes, I lose undo history for my sources because it's integrated with the editor.
  • It doesn't benefit from integration, though, as the source viewer is unusable for stepping: Trying to select a line by clicking on the left margin makes a button appear from nowhere which causes to program to continue to that line, in the editor window, which shouldn't relate to debugging in the first place. Horrible UI and horrible implementation.
  • A hobbled pretty-data "summary" syntax which can't send an object to the Expressions window.
  • he Expressions window isn't aware of any kind of context, ever.
  • Can't select a particular thread to debug, far as I can tell, and doesn't jump to the thread that called abort().

The kernel debugger for Mac OS 9 was better than this. It's time to give up.

What standalone front-ends for GDB work on OS X? I found http://ddd.darwinports.com/ but it's hard to find praise or anecdotes for it, or other alternatives.

Support for STL containers is a big plus for me. I couldn't care less about Objective-C or Apple-anything.

+1  A: 

Have you tried monodevelop? It can build and debug C code, Not show how it handles obj-c.

If you can get DDD working I have used that with good results on many strange platforms. DDD requires X11.

IanNorton
+1  A: 

I've had the same experience with XCode, and ended up switching to Netbeans and Eclipse (still not sure which one I prefer over the other, both have strong and weak points).

This may seem an odd choice, but both of them offer nice C++ support, reasonable debugger integration, and good project management options. I enjoy the refactoring tools and the source version control integration as well. Mind that they are not as snappy and clean as Visual Studio 6.

As many others here, I do not like Objective-C, and am pretty much fed-up with having to learn different environment/frameworks for each platform I write for (I use Linux and OSX daily, Windows on occasion). Both Netbeans and Eclipse are a big plus for portability. They also support other languages that I use sometimes for smaller projects (Python comes to mind).

cjcela
Thanks a ton! I already had Eclipse, so I just had to install the C/C++ package. However, the debugger can't handle 64-bit binaries. The problem appears to be the "binary parser," and looking online it seems I should have an option "Mach-O 64 parser" besides regular Mach-O. Do you know how I install this?
Potatoswatter
I do not know. Sorry. Because of my setup, I've only used it to develop 32-bit applications on OSX. I develop on OSX and then compile on Linux 64-bit for production, using a simple makefile.. sorry. If nothing else works, maybe you could debug in 32-bit and then compile in 64-bit the same way, just using a makefile? In any case, I would be interested in learning how to make Eclipse's debugger for C++ work with 64-bit apps on Snow Leopard. Please post if you find a way. Interesting question - and glad to learn I am not the only one that dislike XCode... Thanks.
cjcela
+2  A: 

I tend to use valgrind for memory related errors; gdb (in a teminal) when I want a backtrace; and logging + couts for all else (if it's not crashing, and there's no memory corruption, the bug seems easier).

Admittedtely, no idea how to debug multi threaded code.

anon
I found also this trick on SO recently that allows easier STL debugging:cd ~ \nsvn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python \n$ cat ~/.gdbinit \npython \nimport sys n\sys.path.insert(0, '/home/USERNAME/python/') \nfrom libstdcxx.v6.printers import register_libstdcxx_printers \nregister_libstdcxx_printers (None) \nend \n(I'll make this an answer as it looks garbled in a comment)
baol
A: 

I add to what anon said that I found also this trick on SO recently that allows easier STL debugging:

$ cd ~
$ svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
$ cat ~/.gdbinit
python
import sys
sys.path.insert(0, '/home/USERNAME/python/')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
baol
Here's a one source of similar advice: http://stackoverflow.com/questions/295836/controlling-eclipse-cdt-debugger-output However, it looks like I'd have to upgrade GDB…
Potatoswatter