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.
This question covers two classes of more specific question:
- When I run my program, it does not produce the output I expect for the input I gave it.
- When I run my program, it crashes and gives me a stack trace. I have examined the stack trace, but I still do not know the cause of the problem because the stack trace does not provide me with enough information.
- When I run my program, it crashes because of a segmentation fault (SEGV).
[What is a debugger and how can it help me diagnose problems?](https://stackoverflow.com/q/25385173)