user:mgardne8:portfolio:debug
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
user:mgardne8:portfolio:debug [2014/10/02 12:35] – created mgardne8 | user:mgardne8:portfolio:debug [2014/10/07 09:01] (current) – mgardne8 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{ : | + | ====== Debugging with GDB ====== |
- | ====Debugging with GDB==== | + | de·bug |
- | ===Intro=== | + | |
- | ???What is BDB? | + | / |
- | !!!GDB, the GNU Project debugger, allows you to see what is going on `inside' | + | |
+ | verb | ||
+ | identify and remove errors from (a computer program). | ||
+ | [(http:// | ||
+ | |||
+ | {{: | ||
+ | ???What is GDB? | ||
+ | !!!GDB, the GNU Project debugger, allows you to see what is going on `inside' | ||
GDB can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act: | GDB can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act: | ||
Line 10: | Line 17: | ||
- Examine what has happened, when your program has stopped. | - Examine what has happened, when your program has stopped. | ||
- Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another. | - Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another. | ||
+ | |||
+ | ???When should I debug? | ||
+ | !!! Debugging is something that can't be avoided. Every programmer will at one point in their programming career have to debug a section of code. There are many ways to go about debugging, from printing out messages to the screen, using a debugger, or just thinking about what the program is doing and making an educated guess as to what the problem is. | ||
+ | |||
+ | Before a bug can be fixed, the source of the bug must be located. For example, with segmentation faults, it is useful to know on which line of code the seg fault is occuring. Once the line of code in question has been found, it is useful to know about the values in that method, who called the method, and why (specifically) the error is occuring. Using a debugger makes finding all of this information very simple.[(http:// | ||
+ | |||
+ | ====== 2 ===== | ||
+ | ==== a ==== | ||
+ | ==== b ==== | ||
+ | ====== 3 ===== | ||
+ | ==== a ===== | ||
+ | ==== b ===== | ||
+ | ====== 4 ===== | ||
~~REFNOTES~~ | ~~REFNOTES~~ |
user/mgardne8/portfolio/debug.1412267754.txt.gz · Last modified: 2014/10/02 12:35 by mgardne8