Summary

  • GNU includes software called a debugger, which allows you to monitor the execution of your programs to locate and remove logic errors.
  • The GNU debugger works only with executable files that were compiled with the -g compiler option, which generates information that is used by the debugger to help you debug your programs.
  • The gdb command will start the GNU debugger and enable you to use its features. The run command will run a program through the debugger.
  • Breakpoints are markers that can be set at any executable line of code. When program execution reaches a breakpoint, execution pauses.
  • The break command inserts a breakpoint at the line number specified after the command.
  • When the program runs, it suspends execution at any line that contains a breakpoint and is said to be in break mode.
  • The continue command causes the program to continue running until the next breakpoint is reached.
  • The print command allows you to peek inside the computer at the value of one of your variables.
  • When the print command is used, the result is stored in a convenience variable such as $1. Convenience variables are temporary variables that can be used in the debugging process to perform arithmetic and evaluate boolean expressions.
  • You can display a list of all of the breakpoints in the program by typing info break.
  • To remove a breakpoint, type delete, followed by a space and the number of the breakpoint to remove.
  • Use the quit command to end the debugging session.
  • The set command allows the programmer to assign new values to variables.
  • The step command executes the next statement in the program. If the next statement to execute is a function call, control transfers to the called function. The step command enables you to enter a function and study the individual statements of that function.
  • The finish command executes the remaining statements in the function and returns control to the place where the function was called.
  • The next command behaves like the step command, except when the next statement to execute contains a function call. In that case, the called function executes in its entirety and the program advances to the next executable line after the function call.
  • The watch command sets a watch on any variable or data member of an object currently in scope during execution of the debugger. Whenever the value of a watched variable changes, the debugger enters break mode and notifies you that the value has changed.

Introduction to Computers, the Internet and World Wide Web

Introduction to C++ Programming

Introduction to Classes and Objects

Control Statements: Part 1

Control Statements: Part 2

Functions and an Introduction to Recursion

Arrays and Vectors

Pointers and Pointer-Based Strings

Classes: A Deeper Look, Part 1

Classes: A Deeper Look, Part 2

Operator Overloading; String and Array Objects

Object-Oriented Programming: Inheritance

Object-Oriented Programming: Polymorphism

Templates

Stream Input/Output

Exception Handling

File Processing

Class string and String Stream Processing

Web Programming

Searching and Sorting

Data Structures

Bits, Characters, C-Strings and structs

Standard Template Library (STL)

Other Topics

Appendix A. Operator Precedence and Associativity Chart

Appendix B. ASCII Character Set

Appendix C. Fundamental Types

Appendix D. Number Systems

Appendix E. C Legacy Code Topics

Appendix F. Preprocessor

Appendix G. ATM Case Study Code

Appendix H. UML 2: Additional Diagram Types

Appendix I. C++ Internet and Web Resources

Appendix J. Introduction to XHTML

Appendix K. XHTML Special Characters

Appendix L. Using the Visual Studio .NET Debugger

Appendix M. Using the GNU C++ Debugger

Bibliography



C++ How to Program
C++ How to Program (5th Edition)
ISBN: 0131857576
EAN: 2147483647
Year: 2004
Pages: 627

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net