HPlogo HP WDB 5.9 Release Notes: HP-UX 11i v1, HP-UX 11i v2, and HP-UX 11i v3 > HP WDB 5.9 Release Notes

What Is New in This Version

» 

Technical documentation

Complete book in PDF

 » Table of Contents

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

Debugger Support for Decimal Floating Point data type

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

Print 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.

Printing Decimal floating point constant
(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

Printing Decimal floating point variable
(gdb) print/<fmt> <var-name>
<fmt> = df, dd, dl
<var-name> - variable name

This prints the decimal floating point variable. If you specify format fmt then it prints the variable based on its data type.

Evaluate Decimal floating point data types

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.

Printing Type of DFP variable
(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:
  • Command line calls of intrinsic functions (Mathematical functions such as cos, sin, and log )

  • Decimal floating point data type support for FORTRAN and c++

  • HP-UX 11iv2 Integrity and HP 9000 systems

Additional Support for binary floating point data type

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>

Support of Binary Floating Point constants – f, l :

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.

Example 1 Binary Floating point constant

(gdb) p <num><f/l>

This prints the binary floating point constant based on its data type.

Support Binary Floating Point variables with format specifier <fmt>

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.

Automatic Preload of librtc.[sl|so]

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.

Simplified Steps for RTC Using the +rtc option for the chatr command:

To use batch mode memory leak detection, complete the following steps:

  1. Compile the source files.

  2. Create an rtcconfig file in the current directory with the required batch mode commands.

  3. Define the environment variable BATCH_RTC at the HP-UX prompt, as follows:

    export BATCH_RTC=on
  4. 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:

  1. Compile the source files.

  2. Set the LD_LIBRARY_PATH environment variable to appropriate directory based on the platform.

  3. Create an rtcconfig file in the current directory with the required thread conditions.

  4. Define the environment variable BATCH_RTC at the HP-UX prompt, as follows:

     export BATCH_RTC=on
  5. 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.

Simplified steps for Run Time Checking in the Attach Mode

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:

  1. 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>
  2. Run the program.

  3. 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:

  1. Set the LD_LIBRARY_PATH environment variable to appropriate directory based on the platform.

  2. 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>
  3. Run the program.

  4. 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.

Availability of a new compiler runtime check option +check=thread

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.

Using Batch RTC to Process the .gdbinit File

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:

http://www.docs.hp.com/en/dev.html

© 2008 Hewlett-Packard Development Company, L.P.