Debugging with GDB (September 2007)

178 Debugging with GDB
14.22 Viewing Wide Character Strings
HP WDB print command can print wide characters and wide-character strings of the
type wchar_t. The user must use the /W option of the print com mand to print wide
characters and wide-character strings.
print /W <wide-char-symbol-name>
14.23 Support for output logging
The Visual Interface for HP WDB terminal user inte rface (TUI) mode supp orts the
command, log logfile_name, that saves the content of a session to the specified log
file.
When you use the log command, the debugger saves a snapshot of the current session,
from the start of the ses sion to the point where you issued the log command. Each
time you use the log command, HP WDB overwrites the specified log file with a new
snapshot from the start of the session.
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 direc-
tory.
To view the log file from Visual Interface for HP WDB, start a shell process and use
the following command:
(gdb) shell vi mylogfile
14.23.1 Support for dumping array in an ASCII file
HP WDBN 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 sim-
ple me chanism 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 cre ated in the current working directory. The content of the file has
the following format:
%%ArrayBrowsing matrix array ARRAY
% A 5x5 matrix
5 5