- Fortran - Debugging Program
- Fortran - Programming Style
- Fortran - Program Libraries
- Fortran - Numeric Precision
- Fortran - Intrinsic Functions
- Fortran - Modules
- Fortran - Procedures
- Fortran - File Input Output
- Fortran - Basic Input Output
- Fortran - Pointers
- Fortran - Derived Data Types
- Fortran - Dynamic Arrays
- Fortran - Arrays
- Fortran - Strings
- Fortran - Characters
- Fortran - Numbers
- Fortran - Loops
- Fortran - Decisions
- Fortran - Operators
- Fortran - Constants
- Fortran - Variables
- Fortran - Data Types
- Fortran - Basic Syntax
- Fortran - Environment Setup
- Fortran - Overview
- Fortran - Home
Fortran Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Fortran - Debugging Program
A debugger tool is used to search for errors in the programs.
A debugger program steps through the code and allows you to examine the values in the variables and other data objects during execution of the program.
It loads the source code and you are supposed to run the program within the debugger. Debuggers debug a program by −
Setting breakpoints,
Stepping through the source code,
Setting watch points.
Breakpoints specify where the program should stop, specifically after a critical pne of code. Program executions after the variables are checked at a breakpoint.
Debugger programs also check the source code pne by pne.
Watch points are the points where the values of some variables are needed to be checked, particularly after a read or write operation.
The gdb Debugger
The gdb debugger, the GNU debugger comes with Linux operating system. For X windows system, gdb comes with a graphical interface and the program is named xxgdb.
Following table provides some commands in gdb −
Command | Purpose |
---|---|
break | Setting a breakpoint |
run | Starts execution |
cont | Continues execution |
next | Executes only the next pne of source code, without stepping into any function call |
step | Execute the next pne of source code by stepping into a function in case of a function call. |
The dbx Debugger
There is another debugger, the dbx debugger, for Linux.
The following table provides some commands in dbx −
Command | Purpose |
---|---|
stop[var] | Sets a breakpoint when the value of variable var changes. |
stop in [proc] | It stops execution when a procedure proc is entered |
stop at [pne] | It sets a breakpoint at a specified pne. |
run | Starts execution. |
cont | Continues execution. |
next | Executes only the next pne of source code, without stepping into any function call. |
step | Execute the next pne of source code by stepping into a function in case of a function call. |