8

Does anyone know a good beginners tutorial for using the debugger in C++?

I feel as if I am missing out on a lot. I know how to step through the code and look at the local variables (although often even this causes me problems, it seems to have a mind of its own sometimes!).

Everything else (call stack, running threads etc.) means nothing to me and I have yet to have a back trace that I can decipher (unlike in the sample problems for segmentation faults when the back trace always points to some function in your code!). Basically I am no better off just inserting cout statements which is normally what I end up doing :)

I am using Code::Blocks but would be willing to temporarily change IDE to learn the debugger if there was a really nice tutorial. The tutorials that I have found either just explain how to step through the code which I already know or they are really comprehensive explaining EVERYTHING, which is just overwhelming for my little brain and not really necessary at this stage.

5
  • 4
    If you don't want to learn EVERYTHING, do you have a sense of what you do want to learn? Perhaps, outside of debugging, learning about the call stack and running threads would help you. That may be why detailed guides are overwhelming you. Sep 22, 2012 at 19:08
  • Sounds like The Hitchhiker's Guide to the Galaxy - The Encyclopedia of Everything.
    – Bo Persson
    Sep 22, 2012 at 20:23
  • You did not specify OS you want to work under. OR I'm blind =). I program mostly under linux now and I learned to use GDB. But for beginners I don't think I saw anything fancier and more user friendly than Visual Studio. I hate programming under windows but graphical debugger there was really pleasant to use.
    – luk32
    Sep 22, 2012 at 21:24
  • Sorry I should have mentioned I am programming on Windows. Thankyou @DrewDormann, I am embarrassed to admit that I didn't stop to think that call stacks etc would be useful outside of the debugger. I will try and learn about these things then hopefully the guides will make more sense to me. When I said I didn't want to know everything I was just meaning that I don't care about learning every trick in the book or what the debugger does in the background if it can be avoided.
    – Beetroot
    Sep 23, 2012 at 6:47
  • Voted to reopen, and protected for historical relevance. Questions asking for 3rd party resources are off-topic today, but this set of questions and answers contains valuable content for all of the users, we send back to show debugging efforts, before asking a question that's related to runtime errors in their code. Aug 26, 2015 at 17:25

1 Answer 1

3

I'd suggest the following tutorial for Visual Studio 2010 to start with. It contains information about call stack, debugging multithreaded program and other things which may be needed. The express edition of Visual Studio 2010 is available for free and AFAIK its debugger has precisely the same features as commercial editions.

1
  • 1
    Or even better, 2012 RC, which is now available for free. Sep 23, 2012 at 12:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.