Debugging with GDB (September 2007)

Chapter 14: HP-UX Configuration-Specific Information 179
0
2
4
6
8
2
..
..
where, ARRAY is the name of the array, and its size is 5x5.
The first two lines are comments about this file and the array. The third line denotes
the array coordinates. From the fourth line, the elements of the array are listed.
Note: This feature is not supported for the Fortran array slices.
14.23.2 Support for Fortran array slices
HP WDB prints Fortran array slices if you specify a range of eleme nts by the Fortran
90 array section syntax. For instance, for an array X declared by REAL, DIMENSION(-
1:1, 2:10) :: X, you could print all five even-numbered elements of the row with the
first dimension equal to 0 by typing the WDB command print X(0,2:10:2).
14.23.3 Displaying enumerators
You can display the union of several enumeration elements by specifying a value if the
elements of the enumeration type are the powers of 2 and the given value is a sum of
any given combination of the enumeration elements.
For example, ass ume you have an enumerated type named color in the program, with
these elements: RED=0, ORANGE=1, YELLOW=2, GREEN=8, and BLUE=16. If you use the
command printf 3, the debugger displays ORANGE|YELLOW, the elements corresponding
to 1 and 2. If you print 5, you will get the value, 5, because it does not form the
sum of any combination in the set. However, if you wanted to print 25, you will get
Orange|Green|Blue.
Values that do not form the sum of any combination of the elements will be displayed
as integers while the values that form the sum of any combination of the elements will
be printed as unions.
14.23.4 Support for debugging typedefs
When you have a typedef class as a template parameter, you can set a breakpoint on
a member function by using the command:
break Class<typedef_classB>::memfunc
14.23.5 Support for steplast command for C and C++
Typically, if a function call has arguments that make further function calls, executing
a simple step command in GDB steps into the argument evaluation call. HP WDB