Fortran – Debugging Program

Fortran debugging program

In this guide, we will discuss 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 line of code. Program executions after the variables are checked at a breakpoint.

Debugger programs also check the source code line by line.

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 โˆ’

CommandPurpose
breakSetting a breakpoint
runStarts execution
contContinues execution
nextExecutes only the next line of source code, without stepping into any function call
stepExecute the next line 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 โˆ’

CommandPurpose
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 [line]It sets a breakpoint at a specified line.
runStarts execution.
contContinues execution.
nextExecutes only the next line of source code, without stepping into any function call.
stepExecute the next line of source code by stepping into a function in case of a function call.

Learn More : Click Here

This Post Has 2 Comments

  1. super slot

    Thanks so much for the blog post.Thanks Again. Really Great.

Leave a Reply