Re: cgdb instead of gdb (or sudo gdb)
Re: cgdb instead of gdb (or sudo gdb)
- Subject: Re: cgdb instead of gdb (or sudo gdb)
- From: Jim Ingham <email@hidden>
- Date: Fri, 17 Jul 2009 16:35:42 -0700
Thanks for the tip! Another trick, if you want to use command-line
gdb but have an auto-updating source display and so forth, is to run
gdb in emacs (with M-x gdb). That works with the Mac OS X emacs/gdb
combo.
We consider it a bug when you HAVE to use gdb from the command line
(as opposed to being able to use the gdb console from Xcode, which we
consider a valuable feature.) So we'd rather spend our time making
gdb in Xcode work better, than making the TUI work in our gdb or
supporting other curses interfaces to the Terminal based gdb.
Jim
On Jul 17, 2009, at 4:12 PM, Kyle McKay wrote:
There have been several posts recently talking about using gdb
instead of the Xcode debugger for debugging in various situations.
I highly recommend using cgdb (instead of using gdb directly) in
these cases.
http://cgdb.sourceforge.net/
http://cgdb.sourceforge.net/screenshots.php
cgdb is a curses front end to gdb that provides constant, auto-
updating display of the source file along with breakpoint and
current line indicators whereas gdb by itself only provides line-
based source file display on demand (the gdb list command).
cgdb can easily be installed via MacPorts or from the installer on
the cgdb downloads page.
It takes exactly the same command line arguments as gdb and can be
used over an ssh terminal session and/or with sudo just like gdb.
cgdb uses the system's gdb to actually do the debugging (the same
way Xcode uses the system's gdb) and so supports everything that the
native Mac OS X gdb does.
It's a shame that Apple doesn't include cgdb as part of the
developer tools package that installs gdb as it really beats having
to continually use the gdb list command to see where you are during
a debugging session in which you need to use gdb directly instead of
the Xcode debugger (for whatever reason).
(NOTE: The gdb source files themselves do have a "TUI" feature that
provides functionality similar cgdb, but the Apple gdb is built with
this feature disabled. If you have used the "gdb -tui" option on
other platforms, cgdb provides a superset of the functionality you
would find in "gdb -tui" and is available on Mac OS X.)
Kyle
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Jim Ingham
Apple Developer Tools
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden