I'm learning C++ and I want to know what is the best C++ debugger for Linux, because there are some things, that is better to use a debugger to get here in Stack Overflow and ask very very simple questions that can be easily solved by a debugger.
Also, there is any book to learn how to use this debugger?
views:
1735answers:
13gdb is popular, widespread, and powerful, though some people can't stand its lack of GUI (but there are many GUIs that work on top of it, of course!).
The wikipedia entry lists about a dozen GUI front-ends for gdb, including IDEs that also offer similarly gooey front-ends to other development tools (compilers, &c) and ways to integrate gdb in some popular, powerful editors (Emacs and Vim) which some developer prefer to "properly GUIish IDEs", especially but not exclusively for developing on Linux and other Unix-like systems.
GDB (http://www.gnu.org/software/gdb/) is a fairly common multi-language debugger that's available for most Linux distributions.
Code Blocks comes with mingw and gdb on windows. It is my favorite on Windows after VS. So, I think it is very good on Linux also.
If you're already using emacs as your editor, you can use
M-x gdb
M-x gdb-many-windows
To use GDB with displays for the source code, registers, etc... Sort of similar to what you get with Visual Studio.
Data Display Debugger
It's a frontend for gdb, I suppose gdb is usable without it, but graphing those pointer swamps is really great.
If none of the gdb front ends take your fancy then Zero Bugs might be worth looking at:
http://www.zero-bugs.com/2.0/product_intro.html
It's commercial, but a reasonable-sounding USD 40, and there's time-limited demo.
To be fair, gdb own interface is the best UI for this debugger I have ever found. With the exception of the front-end provided by a windows IDE that goes by the name of SlickEdit, I have never seen any gdb GUI that beats gdb own interface.
Since you do mention your desire to stay on the console, forget any third-party gdb interfaces and use gdb by itself. You won't regret it and it's very potent.
There is a nice ncurses based frontend for GDB called CGDB: http://cgdb.sourceforge.net/
Short answer : gdb
Long Answer : If you learn how to use gdb all of a sudden you now know how to debug on Mac, Solaris, AIX, Linux, HPUX, cygwin (on Windows) and possibly more platforms. In the long run, getting the same debugging interface on multiple platforms is a blessing in disguise.
I would suggest to use gdb
with emacs
. In emacs
, type M-x gdb
. You are good to go.