Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Debugging itself is the process of finding and exterminating bugs, nothing more and nothing less. So unless you're a perfect programmer who never makes any mistakes, you've done it.</p> <p>A <em>debugger</em>, on the other hand, is a tool which assists in debugging. You can still debug without a debugger, but using a debugger gives you more options, and ways to go about it.</p> <p>Without you mentioning specifically which debugger you're talking about (Visual Studio one, or gdb, or...) we can't really tell you how to use it, but, in a nutshell:</p> <p>A debugger will let you execute the code one instruction at a time, or one line at a time. It will let you run your code until a place you're interested in, then stop. While the code is stopped, you can inspect the values of the variables to make sure things are in order, and in some cases even modify things on the run to test various scenarios.</p> <p>Some of the techniques of debugging without using a debugger are:</p> <ul> <li>print insertion, where you litter your code with printing commands that will allow you to track the state of your code while it is running,</li> <li>code reading, where you read the code and try to find the places where your intention differs from what is actually written</li> <li>mug conversations, where you try to explain your code to your friend (or a mug, or a penguin doll on your desk), and in the process see where your logic goes wrong</li> <li>binary cut search, where you delete chunks of your code at a time and see if the error is still present</li> </ul> <p>and many more.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload