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.
Set a breakpoint To do that, place the cursor in the line of code and press ⌘ \ ( command + \ ). Another way to set a breakpoint is by selecting Run > Toggle Breakpoint from the menu. Visual Studio indicates the line on which the breakpoint is set by highlighting it and displaying a red dot in the left margin.
Click on the Apple menu and choose Shutdown. Restart your Macб and as soon as it starts to boot, press Command-V (If your Mac plays a startup chime, press Command-V as soon as you hear it). Wait until you see white text on the screen and release the keys.
Simple:
Make sure to compile with full debug of course ... which means using option -ggdb
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.
If you are Emacs friendly then: M-x gdb
will put you into "gud" mode. This turns Emacs into a visual debugger. This can be made to work with the new lldb too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With