Handmade Hero»Forums»Code
Dan
21 posts / 2 projects
None
Decent OS X standalone debuggers
Would anyone know of any decent stand alone debuggers for OSX that can use LLDB? (I don't think Xcode supports this mode).

There is a thread on Linux standalone debuggers and they recommended DDD, but that seems that it requires GDB (which I could install with MacPorts) and it seems to be very difficult to use. How compatible are Clang built executables with GDB?
David Owens II
69 posts
A software engineer that enjoys living in enemy territory.
Decent OS X standalone debuggers
Xcode 6 uses LLDB. In fact, it's the only debugger that Xcode supports out of the box.
Dan
21 posts / 2 projects
None
Decent OS X standalone debuggers
Sorry, what I meant by "doesn't support this mode", I was referring to a standalone debug mode, not to the usage LLDB (I am aware that Xcode only uses LLDB). However, I am not aware of a mode where I can just debug an executable in Xcode without having to first create a project, a la DDD or Visual Studio.
David Owens II
69 posts
A software engineer that enjoys living in enemy territory.
Decent OS X standalone debuggers
Edited by David Owens II on
Well, it ends up being the same as VS, but you need to manually do it.

Step 1: Create a new Project using the OS X -> Other -> Empty template. (I put this project in handmade/misc/osx/HandmadeHero.xcodeproj).
Step 2: Create a new scheme (I named mine Handemade Hero)
Step 3: Edit the scheme, under "Run", set the executable to the path to your binary

This allows you to debug the executable now. To break on main, add a symbolic breakpoint.

Debug -> Breakpoints -> Create Symbolic Breakpoint

For the name, enter "main" (or whatever function you want to break on).

[Edit] I've attached a sample.
1 posts
Decent OS X standalone debuggers
Edited by stefan on
Plus you can add your source code files to Xcode so you can set breakpoints as in VS : in the File menu choose 'Add Files to "your-project"'.

Make sure you save your project so you don't have to recreate it.
Then you are able to step through, setup breakpoints, as in VS.

I'm using it that way, I'm following on OSX with SDL2 (mixing code OSX/Linux/SDL).
David Owens II
69 posts
A software engineer that enjoys living in enemy territory.
Decent OS X standalone debuggers
There's no need to add the files to the project; you can set breakpoints without it. Also, then you don't need to manage multiple different project systems. You just need to the hook for debugging that you set up once instead of having to maintain throughout the life time of your project.