Skip to Main Content
The Art of Debugging with GDB, DDD, and Eclipse
book

The Art of Debugging with GDB, DDD, and Eclipse

by Norman Matloff, Peter Jay Salzman
September 2008
Intermediate to advanced content levelIntermediate to advanced
280 pages
6h 31m
English
No Starch Press
Content preview from The Art of Debugging with GDB, DDD, and Eclipse

Persistence of Breakpoints

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, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning x64 Assembly Programming: From Novice to AVX Professional

Beginning x64 Assembly Programming: From Novice to AVX Professional

Jo Van Hoey
Command-Line Rust

Command-Line Rust

Ken Youens-Clark
Modern CMake for C++

Modern CMake for C++

Rafał Świdziński

Publisher Resources

ISBN: 9781593271749Errata Page