Previous | Contents | Index |
This chapter contains the following topics:
You can use these debuggers to debug Compaq Fortran programs:
Ladebug supports Compaq Fortran data types, syntax, and use. Ladebug is a source-level, symbolic debugger that lets you:
The command names and command syntax used by Ladebug and dbx are almost identical. However, Ladebug provides significantly more Compaq Fortran language support than dbx, especially Fortran 95/90 features not found in the FORTRAN-77 standard.
This chapter primarily describes the Ladebug debugger.
4.2 Compaq Fortran Options for Debugging
The -gn options control the amount of information placed in the object file for debugging. To use Ladebug, you should specify the -ladebug option along with the -g , -g2 , or -g3 options.
Table 4-1 summarizes the information provided by the -g n options and their relationship to the -on options.
Option | Traceback Information |
Debugging Symbol Table Information |
Effect on -On Options |
---|---|---|---|
-g0 | No | No | Default is -o4 . |
-g1 (default) | Yes | No | Default is -o4 . |
-g or -g2 1 | Yes | Yes, but for unoptimized code. | Changes default to -o0 . |
-g3 | Yes | Yes, but for unoptimized code. | Default is -o4 . |
-ladebug | Yes | Allows access to Fortran 95/90 dynamic arrays using standard Fortran 95/90 syntax, including array sections. | No effect. |
Traceback information and symbol table information are both necessary for debugging. As shown in Table 4-1, if you specify -g , -g2 , or -g3 , the compiler provides the symbol table and traceback information needed for symbolic debugging. Unless you specify -g0 , the compiler supplies traceback information in the object file.
To use the Ladebug debugger, you should specify the f90 (on Tru64 UNIX systems) or the fort (on Linux systems) command and the command option -ladebug along with -g , -g2 , or -g3 .
Likely uses of these options at the various stages of program development are as follows:
Traceback and symbol table information result in a larger object file. When you have finished debugging your program, you can recompile and relink to create an optimized executable program or remove traceback and symbol table information with the strip command. (See strip(1).)
If your program generates an exception, see Section 4.9, Debugging a Program that Generates an Exception.
4.3 Running the Debugger
The Ladebug debugger provides the following user interfaces in the Compaq Tru64 UNIX operating system Programmer's Development Toolkit:
The examples in this chapter show the character-cell interface to the
Ladebug debugger.
4.3.1 Creating the Executable Program and Running the Debugger
Use the
f90
command with certain options to create an executable program for
debugging. To invoke the debugger, enter the debugger shell command and
the name of the executable program.
4.3.1.1 Invoking Ladebug
The following commands create (compile and link) the executable program and invoke the character-cell interface to the Ladebug debugger:
% f90 -g -ladebug -o squares squares.f90 % ladebug squares Welcome to the Ladebug Debugger Version x.x-xx --------------- object file name: squares reading symbolic information ... done (ladebug) |
In this example, the f90 command:
The ladebug shell command runs the debugger, specifying the executable program squares . The ladebug command accepts various options. (See ladebug(1).)
At the debugger prompt
(ladebug)
, you can enter a debugger command.
4.3.1.2 Invoking dbx
The following commands create the executable program and invoke the dbx debugger (TU*X ONLY). Note that the -ladebug option is omitted, which causes dbx to be used:
% f90 -g -o squares squares.f90 % dbx squares dbx version x.x.x Type 'help' for help. squares: 1 PROGRAM SQUARES (dbx) |
In this example, the f90 command:
The dbx shell command runs the debugger, specifying the executable program squares . The dbx command accepts various options. (See dbx(1).)
At the debugger prompt
(dbx)
, you can enter a debugger command.
4.3.2 Debugger Commands and Breakpoints
To find out what happens at critical points in your program, you need to stop execution at these points and look at the contents of program variables to see if they contain the correct values. Points at which the debugger stops program execution are called breakpoints.
To set a breakpoint, use one of the forms of the stop or stopi commands.
Using the program created in Section 4.3.1, the following debugger commands set a breakpoint at line 4, run the program, continue the program, delete the breakpoint, rerun the program, and return to the shell:
(ladebug) stop at 4 [#1: stop at "squares.f90":4 ] (ladebug) run [1] stopped at [squares:4 0x120001880] > 4 OPEN(UNIT=8, FILE='datafile.dat', STATUS='OLD') (ladebug) cont Process has exited with status 0 (ladebug) delete 1 (ladebug) rerun Process has exited with status 0 (ladebug) quit % |
Other debugger commands include the following:
(ladebug) sh grep FUNCTION data.for INTEGER*4 FUNCTION SUBSORT (A,B) (ladebug) stop in subsort (ladebug) |
For a list of known Ladebug limitations, see the Compaq Tru64 UNIX Ladebug Debugger Manual.
4.4 Sample Program and Debugging Session
Example 4-1 shows a program called SQUARES that requires debugging. The program was compiled and linked without diagnostic messages from either the compiler or the linker. However, this program contains a logic error in an arithmetic expression.
Compiler-assigned line numbers have been added in the example so that you can identify the source lines to which the explanatory text refers.
Example 4-1 Sample Program SQUARES |
---|
1 PROGRAM SQUARES 2 INTEGER INARR(20), OUTARR(20) 3 C ! Read the input array from the data file. 4 OPEN(UNIT=8, FILE='datafile.dat', STATUS='OLD') 5 READ(8,*,END=5) N, (INARR(I), I=1,N) 6 5 CLOSE (UNIT=8) 7 C ! Square all nonzero elements and store in OUTARR. 8 K = 0 9 DO I = 1, N 10 IF (INARR(I) .NE. 0) THEN 11 OUTARR(K) = INARR(I)**2 12 ENDIF 13 END DO 14 15 C ! Print the squared output values. Then stop. 16 PRINT 20, K 17 20 FORMAT (' Number of nonzero elements is',I4) 18 DO I = 1, K 19 PRINT 30, I, OUTARR(I) 20 30 FORMAT(' Element',I4,' has value',I6) 21 END DO 22 END PROGRAM SQUARES |
The program SQUARES performs the following functions:
Note: This example assumes that the program was executed without array bounds checking (set by the Section 3.23 command-line option). When executed with array bounds checking, a run-time error message appears.
When you run SQUARES, it produces the following output, regardless of the number of nonzero elements in the data file:
% squares Number of nonzero elements is 0 |
The logic error occurs because variable K, which keeps track of the current index into OUTARR, is not incremented in the loop on lines 9 through 13. The statement K = K + 1 should be inserted just before line 11.
Example 4-2 shows how to start the debugging session and how to use the character-cell interface to the Ladebug debugger to find the error in the sample program in Example 4-1. Comments keyed to the callouts follow the example.
Example 4-2 Sample Debugging Session Using Program Squares |
---|
% f90 -g -ladebug -o squares squares.f90 (1) % ladebug squares (2) Welcome to the Ladebug Debugger Version x.x-xx --------------- object file name: squares reading symbolic information ... done (ladebug) list 1,9 (3) 1 PROGRAM SQUARES 2 INTEGER INARR(20), OUTARR(20) 3 C ! Read the input array from the data file. > 4 OPEN(UNIT=8, FILE='datafile.dat', STATUS='OLD') 5 READ(8,*,END=5) N, (INARR(I), I=1,N) 6 5 CLOSE (UNIT=8) 7 C ! Square all nonzero elements and store in OUTARR. 8 K = 0 9 DO 10 I = 1, N (ladebug) stop at 8 (4) [#1: stop at "squares.f90":8] (ladebug) run (5) [1] stopped at ["squares.f90":4 0x120001a88] > 8 K = 0 (ladebug) step (6) stopped at [squares:9 0x120001a90] 9 DO 10 I = 1, N (ladebug) print n, k (7) 4 0 (ladebug) step (8) stopped at [squares:10 0x120001ab0]] 10 IF(INARR(I) .NE. 0) THEN (ladebug) s stopped at [squares:11 0x1200011acc] 11 OUTARR(K) = INARR(I)**2 (ladebug) print i, k (9) 1 0 (ladebug) assign k = 1 (10) (ladebug) watch variable k (11) [#2: watch variable (write) k 0x1400002c0 to 0x1400002c3 ] (ladebug) cont (12) Number of nonzero elements is 1 Element 1 has value 4 Process has exited with status 0 (ladebug) quit (13) % vi squares.f90 (14) . . . 10: IF(INARR(I) .NE. 0) THEN 11: K = K + 1 12: OUTARR(K) = INARR(I)**2 13: ENDIF . . . % f90 -g -ladebug -o squares squares.f90 (15) % ladebug squares Welcome to the Ladebug Debugger Version x.x-xx Reading symbolic information ...done (ladebug) when at 12 {print k} (16) [#1: when at "squares.f90":12 { print K} ] (ladebug) run (17) [1] when [squares:12 0x120001ae0] 1 [1] when [squares:12 0x120001ae0] 2 [1] when [squares:12 0x120001ae0] 3 [1] when [squares:12 0x120001ae0] 4 Number of nonzero elements is 4 Element 1 has value 9 Element 2 has value 4 Element 3 has value 25 Element 4 has value 4 Process has exited with status 0 (ladebug) quit (18) % |
% dbx squares dbx version x.x Type 'help' for help. squares: 4 OPEN(UNIT=8, FILE='datafile.dat', STATUS='OLD') (dbx) |
Table 4-2 lists some of the more frequently used debugging commands available in Ladebug and dbx. Many of these commands can be abbreviated (for example, you can enter c instead of cont ). When using the debugger with a windowing interface, you can access these commands by using the windowing interface (command buttons and command menu). For a complete list of available debugger commands, see the ladebug(1) and dbx(1) reference pages.
Command Example | Description |
---|---|
catch | Displays all signals that the debugger is currently set to catch (see also ignore ). |
catch fpe | Tells the debugger to catch the fpe signal (or the signal specified). This prevents the specified signal from reaching the Compaq Fortran RTL. The signals that the Compaq Fortran RTL arranges to catch are listed in Section 8.3. |
catch unaligned | Tells the debugger to catch the unaligned signal, as further described in Section 4.10. The signals that the Compaq Fortran RTL arranges to catch are listed in Section 8.3. |
cont | Resumes execution of the program that is being debugged. Note that there is no Ladebug command named continue . |
delete 2 | Removes the breakpoint or tracepoint identified by event number 2 (see also status ). |
delete all | Removes all breakpoints and tracepoints. |
help | Displays debugger help text. |
history 5 | Displays the last 5 debugger commands. |
ignore | Displays the signals the debugger is currently set to ignore. The ignored signals are allowed to pass directly to the Compaq Fortran RTL. (see also catch ). |
ignore fpe | Tells the debugger to ignore the fpe signal (or the signal specified). This allows the specified signal to pass directly to the Compaq Fortran RTL, allowing message display. The signals that the Compaq Fortran RTL arranges to catch are listed in Section 8.3. |
ignore unaligned | Tells the debugger to ignore the unaligned signal (the default). |
kill | Terminates the program process, leaving the debugger running and its breakpoints and tracepoints intact for when the program is rerun. |
list | Displays source program lines. To list a range of lines, add the starting line number, a comma (,), and the ending line number, such as list 1,9 . |
print k | Displays the value of the specified variable, such as K. |
printregs | Displays all registers and their contents. |
next | Steps one source statement but does not step into calls to subprograms (compare with step ). |
quit | Ends the debugging session. |
run | Runs the program being debugged. You can specify program arguments and redirection. |
rerun | Runs the program being debugged again. You can specify program arguments and redirection. |
return [ routine-name] |
When using the
step
command, if you step into a subprogram that does not require further
investigation, use the
return
command to continue execution of the current function until it returns
to its caller. If you include the name of a routine with the
return
command, execution continues until control is returned to that routine.
The routine-name is the name of the routine, usually named by a PROGRAM, SUBROUTINE, or FUNCTION statement. If there is no PROGRAM statement, the debugger refers to the main program with a prefix of main$ followed by the file name. |
sh more progout.f90 | Executes the shell command more to display file progout.f90 , then returns to the debugger environment. |
show thread | Lists all threads known to the Ladebug debugger. |
status | Displays breakpoints and tracepoints with their event numbers (see also delete ). |
step | Steps one source statement, including stepping into calls of a subprogram. For Compaq Fortran I/O statements, intrinsic procedures, 3f library routines, or other subprograms, use the next command instead of step to step over the subprogram call. Compare with next ; also see return . |
stop in foo | Stops execution (breakpoint) at the beginning of routine foo. |
stop at 100 | Stops execution at line 100 (breakpoint) of the current source file. |
stopi at xxxxxxx | Stops execution at address xxxxxxx of the current executable program. |
thread [ n] | Identifies or sets the current thread context (ladebug). |
watch location | Displays a message when the debugger accesses the specified memory location. For example, watch 0x140000170 . |
watch variable m | Displays a message when the debugger accesses the variable specified by m. |
whatis sym | Displays data type of specified symbol. |
when at 9 { command} | When a specified line (such as 9) is reached, the command or commands are executed. For example, when at 9 {print k} prints the value of variable K when the program executes source code line 9. |
when in name { command} | When a procedure specified by name is reached, the command or commands are executed. For example, when in calc_ave {print k} prints the value of variable K when the program begins executing the procedure named calc_ave. |
where | Displays the call stack. |
where thread all | Displays the stack traces of all threads. |
The debuggers support other special-purpose commands. For example:
To refer to a variable, use either the uppercase or lowercase letters. For example:
(ladebug) print J (ladebug) print j |
You can enter command names in uppercase:
(ladebug) PRINT J |
If you compile the program with the
f90
command option
-names as_is
and you need to examine case-sensitive names, you can control whether
Ladebug is case sensitive by setting the
$lang
environment variable to the name of a case-sensitive language (see
Section 4.8).
4.6.1 Compaq Fortran Module Variables
To refer to a variable defined in a module, insert a dollar sign ($), the module name, and another dollar sign ($) before the variable name. For example, with a variable named J defined in a module named modfile (statement MODULE MODFILE), enter the following command to display its value:
(ladebug) list 5,9 5 USE MODFILE 6 INTEGER*4 J 7 CHARACTER*1 CHR 8 J = 2**8 (ladebug) PRINT $MODFILE$J 256 |
You can display the values of variables in a Fortran common block by using debugger commands such as print or whatis .
To display the entire common block, use the common block name.
To display a specific variable in a common block, use the variable name. For example:
(ladebug) list 1,11 1 PROGRAM EXAMPLE 2 3 INTEGER*4 INT4 4 CHARACTER*1 CHR 5 COMMON /COM_STRA/ INT4, CHR 6 7 CHR = 'L' 8 9 END (ladebug) PRINT COM_STRA COMMON INT4 = 0 CHR = "L" (ladebug) (ladebug) PRINT CHR "L" |
If the name of a data item in a common block has the same name as the
common block itself, the data item is accessed.
4.6.3 Compaq Fortran Derived-Type Variables
Variables in a Fortran 95/90 derived-type (TYPE statement) are represented in Ladebug commands such as print or whatis using Fortran 95/90 syntax form.
For derived-type structures, use the derived-type variable name, a percent sign (%), and the member name. For example:
(ladebug) list 3,11 3 TYPE X 4 INTEGER A(5) 5 END TYPE X 6 7 TYPE (X) Z 8 9 Z%A = 1 10 11 PRINT *,Z%A (ladebug) PRINT Z%A (1) 1 (2) 1 (3) 1 (4) 1 (5) 1 (ladebug) |
To display the entire object, use the PRINT command with the object name. For example:
(ladebug) PRINT Z |
To display the value of a field in a record structure, enter the variable name as: the record name, a delimiter (either a period (.) or a percent sign (%)), and the field name.
To view all fields in a record structure, enter the name of the record
structure, such as REC (instead of REC.CHR or REC%CHR) in the previous
example.
4.6.5 Compaq Fortran Pointer Variables
Compaq Fortran supports two types of pointers:
Fortran 95/90 pointers display their corresponding target data with a print command. You must specify the -ladebug option to provide Ladebug with information about pointers to arrays.
% f90 -g -ladebug point.f90 % ladebug ./a.out Welcome to the Ladebug Debugger Version x.x-xx ------------------ object file name: ./a.out Reading symbolic information ...done (ladebug) stop in ptr [#1: stop in ptr ] (ladebug) list 1:13 1 program ptr 2 3 integer, target :: x(3) 4 integer, pointer :: xp(:) 5 6 x = (/ 1, 2, 3/) 7 xp => x 8 9 print *, "x = ", x 10 print *, "xp = ", xp 11 12 end (ladebug) run [1] stopped at [ptr:6 0x120001838] 6 x = (/ 1, 2, 3/) (ladebug) whatis x int x(1:3) (ladebug) whatis xp (1) int xp(:) (ladebug) s stopped at [ptr:7 0x120001880] 7 xp => x (ladebug) s stopped at [ptr:9 0x120001954] 9 print *, "x = ", x (ladebug) s x = 1 2 3 stopped at [ptr:10 0x1200019c8] (ladebug) s xp = 1 2 3 stopped at [point:12 0x120001ad8] 12 end (ladebug) S xp = 1 2 3 (ladebug) whatis xp (2) int xp(1:3) (ladebug) print xp (1) 1 (2) 2 (3) 3 (ladebug) quit % |
Like Fortran 95/90 pointers, Compaq Fortran (CRAY-style) pointers (POINTER statement) display the target data in their corresponding source form with a print command.
(ladebug) stop at 14 [#1: stop at "dfpoint.f90":14 ] (ladebug) run [1] stopped at [dfpoint:14 0x1200017e4] (ladebug) list 1,14 1 program dfpoint 2 3 real i(5) 4 pointer (p,i) 5 6 n = 5 7 8 p = malloc(sizeof(i(1))*n) 9 10 do j = 1,5 11 i(j) = 10*j 12 end do 13 > 14 end (ladebug) whatis p float (1:5) pointer p (ladebug) print p 0x140003060 = (1) 10 (2) 20 (3) 30 (4) 40 (5) 50 (ladebug) quit % |
For array variables, put subscripts within parentheses, as with Fortran 95/90 source statements. For example:
(ladebug) assign arrayc(1)=1 |
You can print out all elements of an array using its name. For example:
(ladebug) print arrayc (1) 1 (2) 0 (3) 0 (ladebug) |
Avoid displaying all elements of a large array. Instead, display specific array elements or array sections. For example, to print array element arrayc(2):
(ladebug) print arrayc(2) (2) 0 |
An array section is a portion of an array that is an array itself. An array section can use subscript triplet notation consisting of a three parts: a starting element, an ending element, and a stride.
Consider the following array declarations:
INTEGER, DIMENSION(0:99) :: arr INTEGER, DIMENSION(0:4,0:4) :: FiveByFive |
Assume that each array has been initialized to have the value of the index in each position, for example, FiveByFive(4,4) = 44, arr(43) = 43. The following examples are array expressions that will be accepted by the debugger:
(ladebug) print arr(2) 2 (ladebug) print arr(0:9:2) (0) = 0 (2) = 2 (4) = 4 (6) = 6 (8) = 8 (ladebug) print FiveByFive(:,3) (0,3) = 3 (1,3) = 13 (2,3) = 23 (3,3) = 33 (4,3) = 43 (ladebug) |
The only operations permissible on array sections are
whatis
and
print
.
4.6.6.2 Assignment to Arrays
Assignment to array elements are supported by Ladebug.
For information about assigning values to whole arrays and array
sections, see the Fortran chapter in the Compaq Tru64 UNIX Ladebug Debugger Manual.
4.6.7 Complex Variables
Ladebug supports COMPLEX or COMPLEX*8, COMPLEX*16, and COMPLEX*32 variables and constants in expressions.
Consider the following Fortran program:
PROGRAM complextest COMPLEX*8 C8 /(2.0,8.0)/ COMPLEX*16 C16 /(1.23,-4.56)/ REAL*4 R4 /2.0/ REAL*8 R8 /2.0/ REAL*16 R16 /2.0/ TYPE *, "C8=", C8 TYPE *, "C16=", C16 END PROGRAM |
Ladebug supports the display and assignment of COMPLEX variables and constants as well as basic arithmetic operators. For example:
Welcome to the Ladebug Debugger Version x.x-xx ------------------ object file name: complex Reading symbolic information ...done (ladebug) stop in complextest [#1: stop in complextest ] (ladebug) run [1] stopped at [complextest:15 0x1200017b4] 15 TYPE *, "C8=", C8 (ladebug) whatis c8 complex c8 (ladebug) whatis c16 double complex c16 (ladebug) print c8 (2, 8) (ladebug) print c16 (1.23, -4.56) (ladebug) assign c16=(-2.3E+10,4.5e-2) (ladebug) print c16 (-23000000512, 0.04500000178813934) (ladebug) |
Table 4-3 shows the Compaq Fortran data types and their equivalent built-in debugger names:
Fortran 95/90 Data Type Declaration | Debugger Equivalent |
---|---|
CHARACTER | character |
INTEGER, INTEGER(KIND= n) | integer, integer*n |
LOGICAL, LOGICAL (KIND= n) | logical, logical*n |
REAL, REAL(KIND=4) | real |
DOUBLE PRECISION, REAL(KIND=8) | real*8 |
REAL(KIND=16) | real*16 |
COMPLEX, COMPLEX(KIND=4) | complex |
DOUBLE COMPLEX, COMPLEX(KIND=8) | double complex |
COMPLEX(KIND=16), COMPLEX*32 | long double complex |
Expressions in debugger commands use Fortran 95/90 source language syntax for operators and expressions.
Enclose debugger command expressions between curly braces ({ }). For example, the expression print k in the following statement is enclosed between curly braces ({ }):
(ladebug) when at 12 {print k} |
The Compaq Fortran operators include the following:
For More Information:
The Ladebug debugger supports invocation of user-defined specific procedures using Fortran 95/90 source language syntax. Ladebug also supports the invocation of some of the Fortran 95/90 generic and specific procedures, currently limited to scalar arguments.
For More Information:
The Ladebug debugger lets you debug mixed-language programs. Program flow of control across subprograms written in different languages is transparent.
The debugger automatically identifies the language of the current subprogram or code segment on the basis of information embedded in the executable file. For example, if program execution is suspended in a subprogram in Fortran, the current language is Fortran. If the debugger stops the program in a C function, the current language becomes C. The debugger uses the current language to determine the valid expression syntax and the semantics used to evaluate an expression.
The debugger sets the $lang variable to the language of the current subprogram or code segment. By manually setting the $lang debugger variable, you can force the debugger to interpret expressions used in commands by the rules and semantics of a particular language. For example, you can check the current setting of $lang and change it as follows:
(ladebug) print $lang "C++" (ladebug) set $lang = "Fortran" |
When the
$lang
environment variable is set to "Fortran", names are case
insensitive. To make names case-sensitive when the program was compiled
with the
-names as_is
option, specify another language for the
$lang
environment variable, such as C, view the variable, then set the
$lang
environment variable to "Fortran".
4.9 Debugging a Program that Generates an Exception
If your program encounters an exception at run time, to make it easier to debug the program, you should recompile and relink with the following f90 options before debugging the cause of the exception:
If requested, Ladebug will catch and handle exceptions before the Compaq Fortran run-time library does. You can use the Ladebug commands catch and ignore to control whether Ladebug catches exceptions or ignores them:
To obtain the appropriate Compaq Fortran run-time error message when debugging a program that generates an exception (especially one that allows program continuation), you might need to use the ignore command before running the program. For instance, use the following command to tell the debugger to ignore floating-point exceptions and pass them through to the Compaq Fortran run-time library:
(ladebug) ignore fpe |
In cases where you need to locate the part of the program causing an exception, consider using the where command.
For More Information:
As discussed in Chapter 5, unaligned data can slow program execution. You should determine the cause of the unaligned data, fix the source code (if necessary), and recompile and relink the program.
If your program encounters unaligned data at run-time, to make it easier to debug the program, you should recompile and relink with the following command-line options before debugging the cause of the exception:
To determine the cause of the unaligned data when using Ladebug, follow these steps:
% ladebug testprog |
(ladebug) catch unaligned |
(ladebug) run Unaligned access pid=28413 <a.out> va=140000154 pc=3ff80805d60 ra=1200017e8 type=stl Thread received signal BUS stopped at [oops:13 0x120001834] 13 end |
(ladebug) list 12 12 i4 = 1 > 13 end |
(ladebug) where |
To determine the cause of the unaligned data when using dbx (TU*X ONLY), follow these steps:
% dbx testprog |
(dbx) stopi at 0x1200017f0 stopi at 0x1200017f0] |
(dbx) run [2] stopi at 0x1200017f0] [2] stopped at >*[oops:12, 0x1200017f0] stl r3, 0(r1) |
(dbx) where |
If a subprogram uses alternate entry points (ENTRY statement within the subprogram), Ladebug handles alternate entry points as separate subprograms, including:
The Compaq Fortran compiler performs code optimizations ( -o4 ) by default, unless you specify -g (or -g2 ).
Debugging optimized code is recommended only under special circumstances, for example, if a problem disappears when you specify the -o0 option.
One aid to debugging optimized code is to use one of the following command-line options:
By referring to a listing of the generated code, you can see how the compiler optimizations affected your code. This lets you determine the debugging commands you need in order to isolate the problem.
When you try to perform a debugger operation on a variable or language construct that has been optimized, the variable or line may not exist in the debugging environment. For example:
For More Information:
Previous | Next | Contents | Index |