Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)

To run the Visual Interface for HP WDB, use the following command:
$vdb -tui
To redirect HP WDB output to a log file named mylogfile, use the log command in the following
manner:
(gdb) log mylogfile
The Visual Interface for HP WDB stores the log file, mylogfile, in the current directory.
To view the log file from Visual Interface for HP WDB, start a shell process and use the following
command:
(gdb) shell vi mylogfile
Support for dumping array in an ASCII file
HP WDB supports dumping an array into an ASCII file.
The array elements are stored in Array format of Matrix Market in a predefined (column-major
order for Fortran arrays) order. The objective is to provide a simple mechanism to facilitate the
exchange of matrix data and to enable easier parsing of the array elements. For common file
formats, see http://math.nist.gov/MatrixMarket/formats.html.
To dump an array, ARRAY, to a file named DUMPFILE, use the following command:
(gdb) dump2file ARRAY DUMPFILE
The entries of ARRAY are dumped into an ASCII file named DUMPFILE in the array format. The
file is created in the current working directory. The content of the file has the following format:
%%ArrayBrowsing matrix array ARRAY
% A 5x5 matrix
5 5
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.
Support for Fortran array slices
HP WDB prints Fortran array slices if you specify a range of elements 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 HP WDB command print X(0,2:10:2).
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, assume 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.
170 HP-UX Configuration-Specific Information