ialm
ialm

Reputation: 8717

Any tips for a newbie who wants to find a good debugger for C++?

I'm trying to debug my code. I haven't really used a debugger before. I know that in the long run, learning how to use a debugger will be very, very helpful, so I'm trying to find one that suits me. Are there any newbie-friendly debuggers for C++? Ideally with a good GUI...

If not, can anyone point me to a good, newbie-friendly guide to using gdb? My prof recommended it, but it seems to have somewhat of a steep learning curve (at least, for me) since I don't know what to look out for and how to use it. I've tried googling, but I can't seem to find a decent guide.

In short, I just want to set breakpoints and step through the code while checking the values that are being assigned into my variables. Also, being able to view my code while debugging would be awesome.

If its of any importance, I'm running on a mac, and I have gdb installed. I use the NetBeans IDE to code with, and it debugs with gdb (I think), but I don't know how to use it. I have finally decided on trying out a debugger instead of spot-checking my code. I've spent too many hours pulling my hair out on my current programming project. (I'm trying to make an AVL Tree, for those of you who are interested :D)

Thanks!

Upvotes: 1

Views: 336

Answers (5)

StackedCrooked
StackedCrooked

Reputation: 35485

If you are on Mac you should use XCode, if it is not already installed on your system then you can get it from the "Extra tools" disc that came with your Mac.

XCode provides a user-friendly GUI on top of GDB. So you can focus on debugging your code instead of learning an arcane set of commands. And if you really want to dig deeper you can using the GDB console.

Upvotes: 1

int3
int3

Reputation: 13201

The IDE Code::Blocks integrates gdb into its GUI pretty decently.

Upvotes: 1

sellibitze
sellibitze

Reputation: 28097

I recently tried the GUI Insight for GDB and I liked it very much.

Upvotes: 1

Nikwin
Nikwin

Reputation: 6756

If you are having troubles with the UI of GDB, try DDD. It is a graphical front-end for debuggers like GDB, and has quite a number of nice features. You can see a sample session of it here.

Upvotes: 3

Bobby
Bobby

Reputation: 1611

A good tutorial that helped me was: http://www.cs.cmu.edu/~gilpin/tutorial/

Of course that one is a very basic one that can help you start quickly. For a more complete documentation please turn to http://www.delorie.com/gnu/docs/gdb/gdb_toc.html

Upvotes: 1

Related Questions