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 a segmentation fault (SIGSEGV), it references a memory address outside of the memory available to it.
The most frequent causes for a segmentation fault are:
The name of an array index is misspelled.
The calling routine has a REAL argument, which the called routine has as INTEGER.
An array index is miscalculated.
The calling routine has fewer arguments than required.
A pointer is used before it has been defined.
Use dbx to find the source code line where a segmentation fault has occurred.
Use a program to generate a segmentation fault:
demo% cat WhereSEGV.f
INTEGER a(5)
j = 2000000
DO 9 i = 1,5
a(j) = (i * 10)
9 CONTINUE
PRINT *, a
END
demo%
Use dbx to find the line number of a dbx segmentation fault:
demo% f95 -g -silent WhereSEGV.f
demo% a.out
Segmentation fault
demo% dbx a.out
Reading symbolic information for a.out
program terminated by signal SEGV (segmentation violation)
(dbx) run
Running: a.out
signal SEGV (no mapping at the fault address)
in MAIN at line 4 in file "WhereSEGV.f"
4 a(j) = (i * 10)
(dbx)