Copyright © 2008 Hewlett-Packard Development Company, L.P
Legal Notices
Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license.
The information contained in this document is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.
UNIX is a registered trademark of The Open Group.
Intel and Itanium are trademarks or registered trademarks of Intel Corporation or its subsidaries in the United States and other countries.
September 2008
Table of Contents
List of Tables
List of Examples
HP Wildebeest Debugger (WDB) 5.9 is an HP-supported implementation of the open source debugger GDB. It supports source-level debugging of programs written in HP C, HP aC++, and Fortran 90 on Itanium®-based systems running HP-UX 11i v2 or HP-UX 11i v3, and HP 9000 systems running HP-UX 11i v1, HP-UX 11i v2, or HP-UX 11i v3.
This document discusses the most recent product information for HP WDB 5.9
For the latest version of HP WDB, see the HP WDB Technical Resources website at:
This section describes the new features that are introduced in this version of HP WDB.
Debugger Support for Decimal Floating Point data type
Additional Support for binary floating point data type
Automatic Preload of librtc.[sl|so] with new +rtc option for chatr command
Availability of a new compiler runtime check option +check=thread
Batch RTC now enables processing of the .gdbinit file
HP WDB 5.9 enables you to print and evaluate decimal floating point data types for programs running on the September 2008 release of HP-UX 11iv3, Integrity systems. This feature is available only for compiler versions A.06.20 and later.
The various features supported for decimal floating point data types are as follows:
Print Decimal Floating point data types
Evaluate Decimal floating point data types
HP WDB 5.9 enables you to print a decimal floating point data type constant or variable. It handles and prints decimal floating point constant or variable when you use common GDB commands such as stack trace and commands line calls.
(gdb) print <num> <df/dd/dl/DF/DD/DL> df, DF - _Decimal32 dd, DD - _Decimal64 dl, DL - _Decimal128
This prints the decimal floating point constant based on the data type
HP WDB 5.9 enables you to evaluate the decimal floating point variable and display the output. Use the commonly used gdb commands for evaluating and displaying expressions such as print to evaluate the decimal floating point variable.
HP WDB supports:
Evaluation of expressions with decimal floating point constants and variables.
Setting or assignment of decimal floating point constant or variable.
Arithmetic operations such as addition, subtraction, multiplication, division, and negation with decimal floating point constants or variables.
Comparison operations such as ==, !=, >, >=, <, <= with decimal floating point constants or variables.
Conversion between data types during assignment, arithmetic and comparison operations and while printing values in specified format.
(gdb) ptype <dfp-const>/<dfp-var>
It prints the type of the DFP variable or constant.
HP WDB handles exceptions such as overflow, infinity and division by zero for decimal floating point data type.
HP WDB handles finite, infinite and NaN (Not a Number) values of decimal floating point data type.
Note: | |
---|---|
HP WDB does not support decimal floating point data type for the following:
|
HP WDB 5.9 provides the following support for binary floating point data type:
Support of Binary Floating Point constants – f, l :
Support Binary Floating Point variables with format specifier <fmt>
If the binary floating point constant contains the letter f or l then HP WDB recognizes it as float or long double binary floating point constant. Generally a floating point constant without f or lis considered as double binary floating point constant.
HP WDB 5.9 prints the variable in the specified binary floating point format. The following are the new format specifiers for binary floating point variables:
(gdb) p/f <var-name>
This prints the binary floating point value as float.
(gdb) p/db <var-name>
This prints the binary floating point value as double.
(gdb) p/l <var-name>
This prints the binary floating point value as long double.
The new +rtc option for the chatr command enables you to automatically preload the librtc.[sl|so] runtime library. In addition to automatically preloading the librtc.[sl|so] library, it also maps the shared library as private. This enhancement simplifies the current method of explicitly preloading the appropriate librtc.[sl|so] library using the LD_PRELOAD environment variable.
The +rtc<enable|disable> option is available for dynamic linker versions B.11.66 and later on HP 9000 systems, and dynamic linker versions B.12.51 and later on Integrity systems.
To set the target application to preload librtc.[sl|so], enter the following command at the HP-UX prompt:
$ chatr +rtc enable <executable>
The +rtc option for the chatr simplifies the steps for batch mode and attach mode of memory and thread debugging. Run Time Checking (Memory and Thread debugging) is made available using this option.
To use batch mode memory leak detection, complete the following steps:
Compile the source files.
Create an rtcconfig file in the current directory with the required batch mode commands.
Define the environment variable BATCH_RTC at the HP-UX prompt, as follows:
export BATCH_RTC=on
Enter the following command at the HP-UX prompt to set the target application to preload librtc.[sl|so] :
$ chatr +rtc enable <executable>
At the end of the run, output data file is created in output_dir (if defined in rtcconfig), or the current directory.
To use batch mode thread debugging, complete the following steps:
Compile the source files.
Set the LD_LIBRARY_PATH environment variable to appropriate directory based on the platform.
Create an rtcconfig file in the current directory with the required thread conditions.
Define the environment variable BATCH_RTC at the HP-UX prompt, as follows:
export BATCH_RTC=on
Enter the following command at the HP-UX prompt to set the target application to preload librtc.[sl|so]:
$ chatr +rtc enable <executable>
If HP WDB detects any thread error condition during the application run, the error log is output to a file in the current working directory. The output file has the following naming convention:
<executable name>.<pid>.threads
where:
pid is the process id.
This section describes the simplified steps for Run Time checking in the Attach mode using the +rtc option for the chatr command.
For debugging memory after attaching GDB to a running process, complete the following steps:
Enter the following command at the HP-UX prompt to set the target application to preload the librtc.[sl|so] runtime library.
$ chatr +rtc enable <executable>
Run the program.
Start the debugging session, as follows:
gdb -leaks <executable-name> <process-id>
For debugging threads after attaching GDB to a running process, complete the following steps:
Set the LD_LIBRARY_PATH environment variable to appropriate directory based on the platform.
Enter the following command at the HP-UX prompt to set the target application to preload the librtc.[sl|so] runtime library:
$ chatr +rtc enable <executable>
Run the program.
Start the debugging session, as follows:
Attach the debugger to the required process and enable thread debugging, as follows:
gdb -thread -p <process-id>
Or
gdb -thread <executable> <process-id>
Alternately, you can attach the process to the debugger and consequently invoke thread debugging, as follows:
$ gdb <executable> <pid> (gdb)set thread-check on
Note: | |
---|---|
+mem_check to chatr command can be used to automatically preload the library for memory debugging. The +mem_check option to chatr command doesn’t support automatic preloading of libraries needed for thread debugging. |
The new compiler runtime check option +check=thread enables batch mode thread debugging features of HP WDB, without setting any other environment at runtime. +check=thread must only be used with multi-threaded programs. It is not enabled by +check=all. This feature is available only for compiler versions A.06.20 and later.
Batch RTC now enables processing of the .gdbinit file. You can use the .gdbinit file to specify path settings such as dir, objectdir, and pathmap to set the path of the source and object files in case the source or object paths are different than the current directory, so that the generated RTC reports display the symbol names and line numbers correctly. This feature is optionally enabled only when the RTC_PROCESS_GDBINIT variable is set to 1. This feature has some limitations on what commands in the .gdbinit file. For more information on this feature, see the Debugging with GDB user manual and the Debugging Dynamic Memory Usage Errors Using HP WDB white paper at:
The following defects are fixed in HP WDB 5.9:
The disable command produces misleading information for multi-threaded programs.
The pxdb fails with an out of memory error message while reading files of size 2 GB.
WDB incorrectly reports heap object registered with different size when an application is compiled with +check=bounds:pointer to perform out of bounds check.
WDB incorrectly reports value of thread-local variable.
The next command fails to step into a forked child process.
WDB does not recognize pack core filenames with extensions other than .tar.Z. If the application is compiled with +check=memory, it crashes while WDB attempts to print the memory information.
Batch RTC fails even when the output_dir command is set and the current working directory does not have write permission.
WDB is unable to perform Java debugging.
Following are some notes, cautions, and warnings related to WDB 5.9:
The Run Time Checking feature (Interactive and Batch Mode) of WDB cannot be used with applications that redefine or override the default system-supplied versions of the standard library routines (under libc.[sl|so] and libdld.[sl|so]).
Table 1 lists the dependent library routines for Run Time Checking using HP WDB.
Table 1 Dependent Library Routines for Run Time Checking using WDB
abort |
atoi |
chdir |
clock_gettime |
creat |
ctime |
uwx_register_callbacks |
strstr |
dlhook |
U_STACK_TRACE |
uwx_get_reg |
write |
execl |
exit |
fclose |
fopen |
fprintf |
fscanf |
getcwd |
getenv |
getpid |
lseek |
memchr |
open |
printf |
rand |
pthread_self |
putenv |
shl_findsym |
shl_get_r |
shl_load |
shl_unload |
sprintf |
srand |
sscanf |
strcasecmp |
strdup |
strlen |
strchr |
strtok_r |
time |
unlink |
uwx_self_copyin |
strchr |
uwx_step |
uwx_init |
perror |
shmctl |
write |
strcmp |
shl_get |
close |
dlgetname |
environ |
fork |
getpagesize |
uwx_self_init_context |
pthread_getschedparam |
uwx_self_init_info |
uwx_register_alloc_cb |
strstr |
uwx_register_callbacks |
uwx_self_lookupip |
The Run Time Checking (dynamic memory, libraries, and pthreads checking) in WDB is dependent on the semantics and the standard behavior of these library routines. Run Time Checking in WDB results in unexpected and unpredictable behavior when used with applications that substitute or redefine these library routines.
Before enabling the Run Time Checking feature in WDB, use the nm command to determine if your application or the dependent libraries in your application redefine or substitute these library routines.
Batch Mode RTC displays one of the following errors and causes the program to temporarily hang if the version of WDB and librtc.[sl|so] do not match, or if WDB is not available on the system:
/opt/langtools/bin/gdb: unrecognized option `-brtc' Use `/opt/langtools/bin/gdb --help' for a complete list of options.
Or
execl failed. Cannot print RTC info: No such file or directory
This error does not occur under normal usage where WDB or librtc.[sl|so] is used from the default location at /opt/langtools/...
However, this error occurs if GDB_SERVER and/or LIBRTC_SERVER are set to a mismatched version of WDB or librtc.[sl|so] respectively.
If the application does not link in the libpthread library (lipbpthread.so|libpthread.s1) or the libpthread tracer library (libpthread_tr_so.l|libpthread_tr.l ), the following error message appears:
Tracing version of libpthread is not loaded: set thread_check before starting the program, link your program with libpthread_tr or set LD_LIBRARY_PATH to contain /opt/langtools/wdb/lib/hpux32
HP-WDB Debugger does not display backtrace under Backtrace at the point of event occurrence for thread conditions detected at thread-exit, if there is an implicit call to pthread_exit().
This section describes known problems and the suggested workarounds in this release of HP WDB.
Debugging an attached process that is not compiled for debugging may generate warnings
On attaching the debugger to a program that is not compiled for debugging, the process may stop in a system call and the following warning message about the various registers is displayed:
No data warning: reading 'r3' register: No data warning: reading 'r4' register: No data warning: reading 'r5' register: No data warning: reading 'r6' register: No data warning
This warning occurs when executing the step command, the backtrace command, or when attempting to view the register information. To avoid this warning message, use the finish command to execute the process until the system call returns. This warning message is generated when the process stops at a system call, and the registers cannot be read by the debugger. When the debugger calls the routine ttrace, it returns this warning.
Error attaching WDB to a process that is traced by tools using ttrace
HP WDB cannot attach to a process that is traced by tools that use ttrace, such as Caliper, adb, and tusc.
The debugger displays the following error message while attempting to attach to such a process:
Attaching to process <pid> failed. Hint: Check if this process is already being traced by another gdb or other ttrace tools like caliper and tusc. Hint: Check whether program is on an NFS-mounted file-system. If so,you will need to mount the file system with the "nointr" option with mount(1) or make a local copy of the program to resolve this problem.
This section describes known issues in this release of HP WDB.
During the execution of advanced thread checking for applications that fork, in the interactive mode, the following message appears if the GDB follows the child:
Pthread analysis file missing!
This error message appears because the thread-error information for the forked process is not available. However, if the forked process exec() s another binary, the thread-error information is available for the exec-ed binary.
In both interactive and batch modes, if the applications exceed their thread stack utilization, the following error message appears:
Error accessing memory address!
This occurs when GDB attempts a command line call on an already overflowing thread stack.
This section describes known limitations in this release of HP WDB.
The feature does not obtain the thread-error information in batch mode for forked process in a multiprocessing application. However, if the librtc.sl library is pre-loaded, the debugger obtains the thread-error information in the batch mode for exec-ed application.
You cannot specify an alternate output directory for the thread-error log. The thread-error log file is output into the current working directory only.
HP WDB cannot execute both batch mode thread check and batch mode heap check together. If the rtcconfig file has both entries, then batch heap check overrides the batch thread check.
On PA-RISC systems for 32-bit and 64-bit applications, printing of local variable values may be inaccurate for +O1 and higher optimizations.
Note: | |
---|---|
HP WDB 5.9 contains limited debugging support for optimized PA-RISC 32-bit applications and even more limited support for debugging optimized code (DOC) on PA-RISC 64-bit applications. Additionally, the debugging support becomes limited as higher levels of compiler optimization are used. |
This section discusses the installation information for HP WDB.
Table 2 lists the swinstall products for HP WDB.
Table 2 HP WDB Installation
Product Name | Description |
---|---|
HP WDB | HP WDB — The HP implementation of the open source debugger GDB |
HP WDB GUI | Optional graphical user interface component for HP WDB |
If you install HP WDB GUI on a system where HP WDB has not yet been installed, HP WDB is installed automatically.
HP WDB is not supported on releases of the HP-UX operating system prior to 11i v1.
The following configurations are supported by HP WDB:
Installing and running locally on an HP-UX 11i v1, HP-UX 11i v2, or HP-UX 11i v3 operating system.
Installing on an HP-UX 11i v1, HP-UX 11i v2, or HP-UX 11i v3 system, with the display redirected to a remote HP-UX 11.x node.
The HP WDB product contains the following components:
WDB: Runtime contains one fileset
WDB-DOC: Documentation contains one fileset
WDB-MAN: Manuals contains one fileset
Note: | |
---|---|
DEBUG-PRG and SENTINEL are co-requisite filesets for HP WDB and are automatically selected during installation. |
The WDB GUI product contains the following sub-products:
WDB-GUI-RUN: Runtime contains one fileset
WDB-GUI-HELP: Help contains one fileset
WDB-GUI-MAN: Manuals contain one fileset
HP WDB GUI requires the HP WDB product. If HP WDB is not already installed, it is automatically selected during installation.
For information on the disk space requirements to install HP WDB 5.9, see the Downloads website at:
To install HP WDB, run the SD-UX swinstall command. It invokes a user interface that leads you through the installation. It also gives you information about disk space requirements, version numbers, product descriptions, and dependencies.
For specific installation instructions, see the HP WDB Technical Resources website at:
For more information on installation procedures and related issues, see the Managing HP-UX Software with SD-UX and other README, installation, and upgrade documentation provided with the HP-UX 11.x operating system package.
Note: | |
---|---|
If you install a compiler product that includes a version of HP WDB earlier than this version, swinstall generates the following message: ERROR: A later revision (one with a higher revision number) of fileset "WDB-GUI.WDB-GUI-HELP,r=B.11.31" has already been installed. Either remove this fileset or change the "allow_downdate” To retain the later version of HP WDB, ignore this message. The new products are installed, and the latest version of HP WDB continues to be available. |
For information on previous HP WDB releases, see the HP WDB Technical Resources website at:
HP WDB documentation is available at the following location:
/opt/langtools/wdb/doc
Table 4 lists the documents available for HP WDB.
Table 3 HP WDB Documentation
Document | Format | Location |
---|---|---|
Debugging with GDB |
|
/opt/langtools/wdb/doc/gdb.pdf Emacs: /opt/langtools/wdb/doc/gdb.info (Copy the files to your info directory first.) |
GDB Quick Reference Card |
|
/opt/langtools/wdb/doc |
Getting Started with HP WDB |
HTML |
/opt/langtools/wdb/doc/html/wdb/C/GDBtutorial.html |
XDB to WDB Transition Guide |
HTML |
/opt/langtools/wdb/doc/index.html |
Using the HP WDB Terminal User Interface |
HTML |
/opt/langtools/wdb/doc/index.html |
GDB manpage | gdb(1) |
To receive an electronic mail message only when HP releases a new version of HP WDB, subscribe to the product news mailing list.
Send an electronic mail message to:
To add yourself to the list, type the following in the subject of the message:
subscribe wdb-announce
To remove yourself from the list, type the following in the subject of the message:
unsubscribe wdb-announce