title: What is a debugger and how can it help me diagnose problems?
body: <p>This is intended to be a general-purpose question to assist new programmers who have a problem with a program, but do not know how to use a debugger to diagnose the cause of the problem.</p>
  <p>This question covers three classes of more specific question:</p>
  <ul>
  <li>When I run my program, it does not produce the output I expect for the input I gave it.</li>
  <li>When I run my program, it crashes and gives me a stack trace. I have <a href="https://stackoverflow.com/questions/3988788/what-is-a-stack-trace-and-how-can-i-use-it-to-debug-my-application-errors">examined the stack trace</a>, but I still do not know the cause of the problem because the stack trace does not provide me with enough information.</li>
  <li>When I run my program, it crashes because of a segmentation fault (SEGV).</li>
  </ul>