views:

100

answers:

2

I am porting a project over to OS X. I am finding GDB debugging in the console to be woefully insufficient and really need a visual debugger. My project is built using Scons and as such, it sidesteps Xcode's IDE entirely. This is acceptable until I need to fire up a visual debugger and step through my code.

Aside from generating and maintaining an Xcode project (to supplement all of the other platforms I have to support already), what can I do to get a visual debugger up and running on OS X?

This is for a C++ project.

+2  A: 

Simple,

  1. start XCode
  2. Click 'Run' in top menu
  3. Choose attach to process, choose the process you want to debug

make sure to compile with full debug of course ... which means using option -ggdb

T.

tomdemuyt
This attaches a debugger, yes, but it doesn't mean I can open a project file (even with File->Open), go to a line and add a breakpoint.I get a nice warning:GDB Warning: No location found for "cl_game.cpp:711"
sludge
UPDATE: I stand corrected. I changed from -g to -ggdb in Scons, but the final binary copy failed and I failed to notice that. -ggdb must contain the full pathname to the source file (or something equally telling) because this works.
sludge
UPDATE 2: Now it isn't working again with other files in other directories.
sludge
A: 

Xcode supports makefile projects - you can just drag all your source into a new legacy project template, set up the makefile command line, tell it where the executable lives, and you're in business.

Paul R
This goes against what I said above about wanting to maintain an Xcode project file. I do not need to maintain an Xcode file every time I add, remove or delete a source file in addition to Scons and Visual Studio.
sludge