Right now I am using gdb on command line in Ubuntu. It seems pretty inefficient and cumbersome. Is that just because of the learning curve or because it is really that way? Do "real" c++ programmers use gdb? I felt the same way about vi until I learned to use it and now I enjoy it, but I feel like I'm wasting my time with gdb. Considering switching to Code::Blocks for debugging. I know there is a plugin for vi that will allow you to watch your program execute in there but I need something to be able to watch my variables, ect as well.

Recommended Answers

All 3 Replies

GDB is a very powerful tool. It has many interfaces (DDD, kdbg, ...)
The usefulness of this tool - regardless of its interface - is going to be your level of involvement. The more you use it and explore it's facilities the more comfortable you will become with the tool. Each interface will offer something different for you, but the underlying mechanism is what you are going to have to learn. If you've taken the time to learn vi - the real powerful parts of vi, not just insert vs. command mode - then you should find this exercise equally satisfying.

GDB is a supremely powerful tool and is extremely useful.
As L7Sqr has pointed out; as with any tool, you need to learn how to use it properly before you reap the full benefits. And as with most things, this can take a little time to achieve. But it is time well invested IMHO!

If you prefer a graphical environment rather than doing it all via the command line, there are several graphical frontends available for gdb (DDD, kdbg being two listed by L7Sqr, but there are several others)

Code::Blocks also uses gdb for debugging on Linux. Again, the IDE acts as a convenient graphical front-end. Great for general purpose debugging, but to use gdb to its full potential; you can't beat doing it via the command line IMHO!

And if RTFM is getting you nowhere, there are gdb related tutorials posted all over the web. So googling for some tutorials might be an idea:
http://tinyurl.com/5ugq3fp

Anyway, that's my two pence on the matter!
Cheers for now,
Jas.

I second the posters on Power of GDB. I use it with Codelite, and I enjoy polished interface. I was just debugging my current project few minutes ago with C++.

I certainly recommend CodeLite

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.