Debugging - What is it and how to do it? Basics?

Jul 25, 2018 at 3:25am
Hey Everyone i've been pointed out several times that i should learn how to debug a program. The thing is i don't know the first thing about it. So could anyone just give me some kind of reference material about how to debug and does the debugging differ in various IDE's? I mostly use Clion,Codeblocks,Pycharm,DataGrip and RubyRail,Is the debugging process for each language different? Please help me get started
Jul 25, 2018 at 12:58pm
Yes, the debugging process is mostly the same, although the quality can differ depending on your language/IDE. For example, I would say C# can be easier to debug than C++. There are breakpoints that can be placed that trigger your code to stop executing right before certain lines that you want to check. When you want to continue execution, you can either continue normally, or you can continue so that your debugger pauses after every line of code it executes. By "stepping in" to a function, you can then explore each line of that function, one by one. All current variables you have access to should be listed somewhere on your IDE, so that you know what variables are doing what at a given slice of time. Otherwise, you can "step over" a function if you are already sure what that function is doing.

Debugging with CodeBlocks (I haven't debugged in CB that much):
http://wiki.codeblocks.org/index.php/Debugging_with_Code::Blocks
http://www.cplusplus.com/forum/beginner/215177/

I find debugging in Visual Studio to be very nice.
Last edited on Jul 25, 2018 at 12:58pm
Jul 25, 2018 at 6:04pm
Beyond the debugger, it becomes an art that you just refine by practice. There are tons of techniques that you can try, depending on what you are dealing with. Once you get outside the debugger, you have a serious problem though.

Topic archived. No new replies allowed.