September 2008
Intermediate to advanced
280 pages
6h 31m
English
We said "much later on" above to make the point that you should not exit GDB during your debugging session. For example, when you find and fix one bug, but other bugs remain, you should not exit and then re-enter GDB to use the new version of your program. That would be unnecessary trouble, and more importantly, you would have to re-enter your breakpoints.
If you do not exit GDB when you change and recompile your code, the next time you issue GDB's run command, GDB will sense that your code has changed and automatically reload the new version.
However, note that your breakpoints may "move." For instance, consider the following simple program:
1 main()
2 { int x,y;
3 x = 1;
4 y = 2;
5 }
We compile, enter GDB, ...