This commit is contained in:
Miloslav Ciz 2024-02-10 12:19:55 +01:00
parent 9d1876387b
commit be97db7fc4
24 changed files with 1754 additions and 1683 deletions

View file

@ -17,6 +17,8 @@ Debugging programs mostly happens in these steps:
3. **Locating it**: now as you have a crashing program, you examine it and find WHY exactly it crashes, which line of code causes the crash etc.
4. **Fixing it**: now as you know why and where the bug exists, you just make it go away. Sometimes a [hotfix](hotfix.md) is quickly applied before implementing a proper fix.
For debugging your program it may greatly help to make **debugging builds** -- you may pass flags to your compiler that make the program better for debugging, e.g. with [gcc](gcc.md) you will likely want to use `-g` (generate debug symbols) and `-Og` (optimize for debugging) flags. Without this debuggers will still work but may be e.g. unable to tell you the name of function inside which the program crashed etc.
The following are some of the most common methods used to debug software, roughly in order by which one typically applies them in practice.
### Testing