4. Viewing and Navigating To Code
5. Controlling Program Execution
6. Setting Breakpoints and Traces
8. Evaluating and Displaying Data
11. Debugging Multithreaded Applications
16. Debugging Fortran Using dbx
Running the Sample dbx Session
Viewing Fortran 95 Derived Types
Pointer to Fortran 95 Derived Type
17. Debugging a Java Application With dbx
18. Debugging at the Machine-Instruction Level
19. Using dbx With the Korn Shell
If a program gets an exception, there are many possible causes. One approach to locating the problem is to find the line number in the source program where the exception occurred, and then look for clues there.
Compiling with -ftrap=common forces trapping on all common exceptions.
To find where an exception occurred:
demo% cat wh.f
call joe(r, s)
print *, r/s
end
subroutine joe(r,s)
r = 12.
s = 0.
return
end
demo% f95 -g -o wh -ftrap=common wh.f
demo% dbx wh
Reading symbolic information for wh
(dbx) catch FPE
(dbx) run
Running: wh
(process id 17970)
signal FPE (floating point divide by zero) in MAIN at line 2 in file “wh.f”
2 print *, r/s
(dbx)