HPlogo HP WDB 5.2 Release Notes: HP 9000 and HP Integrity Systems > Chapter 1 Announcement

Summary of Changes in HP WDB 4.5

» 

Technical documentation

Complete book in PDF

 » Table of Contents

This version includes corrections to defects as well as several enhancements.

  • Support for the backtrace_other_thread  command: Prints the backtrace of all stack frames for a thread with stack pointer SP, program counter PC and address of gr32 in the backing store BSP.

    Usage: backtrace_other_thread SP PC BSP

    This is useful to get stack traces when the stack is corrupted.

    NOTE: Use this command carefully and make sure that you are giving reasonable SP, PC, and BSP values.
  • New packcore command: The packcore command takes a user-specified core file, identifies the shared libraries used by the core, and creates a tar file called core.tar with all those libraries along with the executable. You can view the usage information by executing the help packcore on command at the gdb prompt.

  • Support for batch mode RTC: HP WDB supports batch mode memory leak detection, also called batch Run Time Checking (RTC). You can specify the batch mode configuration through a configuration file called rtcconfig. The configuration file supports these variables:

    Table 1-6 Title not available (Summary of Changes in HP WDB 4.5 )

    Variable

    Description

    check_heap=on

    To enable heap info

    check_leaks=on

    To enable leak detection

    scramble_blocks=on|off

    To enable block scrambling

    min_leak_size=block_size

    Minimum block size to use for leak detection

    frame_count=no_frames

    Number of frames to be printed for leak context

    output_dir=output_data_dir

    Name of the output data directory

    files=file1:file2:...|fileN>

    Executables for which memory leak detection is enabled.

     

    Batch mode leak detection stops the application at the end, when libraries are being unloaded, and invokes HP WDB to print the leak or heap data.

    To use batch memory leak detection:

    1. Debug Enable the application using any of the following:

      chatr +dbg enable <application>
      pxdb -s on <application>
      NOTE: This works only on PA-RISC systems because pxdb does not exist on Itanium systems.
    2. Create an rtcconfig file in the current directory.

    3. Define an environment variable BATCH_RTC. If you are using the Korn or Posix shell, type:

      export BATCH_RTC=on 
    4. For 64-bit PA-RISC applications, set the GDB_SERVER to pick the gdb64 as follows:

      export GDB_SERVER=/opt/langtools/bin/gdb64
    5. Start the target application by defining LD_PRELOAD of librtc. For example,

      LD_PRELOAD=/opt/langtools/lib/librtc.sl application_name
      LD_PRELOAD=/opt/langtools/lib/pa20_64/librtc.sl application_name
      NOTE: This pathname is applicable only to PA-RISC systems.
    6. At the end of the run output data file is created in the output_data_dir, if defined in rtcconfig, or the current directory.

      HP WDB creates output data file for each run. It creates a separate file for leak detection and heap information.

      The naming convention for output files is:

      file_name.pid.suffix 

      The value for suffix could be either leaks or heap.

    Batch memory leak detection uses these environment variables:

    Table 1-7 Title not available (Summary of Changes in HP WDB 4.5 )

    VariablesDescription
    GDBRTC_CONFIG

    Specifies the location of rtcconfig.

    BATCH_RTC

    Enables or disable batch memory leak detection.

    GDB_SERVER

    By default, memory leak detection uses /opt/langtools/bin/gdb to print output.Override this with GDB_SERVER.

     

  • Preliminary support for GDB-MI: GDB-MI is a line-based, machine-oriented text interface to GDB. It is specifically intended to support the development of systems which use the debugger as just one small component of a larger system.

    GDB-MI can be invoked by giving the command line option -i=mi with gdb.

    For example:

     $gdb -i=mi
    NOTE:
    • Refer to the “Debugging with GDB” document for details on the specification of the GDB/MI interface.

    • GDB-MI is still under construction. Some of the features are incomplete and subject to change. The following GDB/MI commands do not work:

      • Setting breakpoints using regular expressions (-break-insert -r)

      • Setting access watchpoints and read watchpoints (-break-watch -a|-r)

  • Support for deferred watchpoints: When you try to set a watchpoint in an expression, HP WDB places a deferred watchpoint if HP WDB cannot evaluate the expression. The watchpoint is automatically enabled whenever the expression can be evaluated during the program’s execution. This is especially useful when placing the watchpoints on unallocated addresses.

  • Support for alternate root functionality: HP WDB supports  alternate root functionality, which helps you use HP WDB and its components installed on an alternate root rather than the system with HP WDB or its components installed.

    The environment variable, WDB_ROOT, specifies the alternate root for HP WDB GUI. You must specify a structure similar to the default, /opt/langtools. You can use the environment variable, GDB_ROOT, to specify an alternate root for WDB.

    For example, $ export GDB_ROOT=$HOME/opt/langtools.

    If you specify both WDB_ROOT and GDB_ROOT, the value for GDB_ROOT is ignored. HP WDB supports these environment variables to override the location of different component of HP WDB. The following table specify these environment variables in the increasing order of precedence:

    Table 1-8 Title not available (Summary of Changes in HP WDB 4.5 )

    Defined VariableWDB GUI LocationWDB Locationlibrtc.sl location

    NONE

    /opt/langtools/bin

    /opt/langtools/bin

    /opt/langtools/lib

    WDB_ROOT

    $ WDB_ROOT/bin

    $ WDB_ROOT/bin

    $ WDB_ROOT/lib

    GDB_ROOT

    N/A

    $ WDB_ROOT/bin

    $ WDB_ROOT/lib

    GDB_SERVER

    N/A

    $ GDB_SERVERN/A

    LIBRTC_SERVER

    N/A

    N/A

    $ LIBRTC_SERVER

     

    NOTE:
    • If you define WDB_ROOT or GDB_ROOT but do not create the correct directory structure below it, the debugger may fail.

    • If alternate root is defined and the application is not processed by pxdb, then gdb runs [$WDB_ROOT | $GDB_ROOT]/bin/pxdb on the executable in non-existence of /opt/langtools/bin/pxdb.

  • New pathmap command: The new command, pathmap, allows you to define a list of substitution rules to be applied to path names to identify object files and the corresponding source files. The pathmap command, however, may not find source files if the object files are not available.

    This minimizes or eliminates the need to specify multiple objectdir commands when object files are moved from the compilation directories or when compilation directories are mounted over NFS.

    To use this feature, your program must  be compiled with the +objdebug option. For information on how pathmap works type help pathmap at the HP WDB prompt.

  • Core file validation: HP WDB automatically detects mismatches between a library in a core file and the library used by HP WDB when it is invoked on the core

    The debugger shows a list of the mismatched libraries. You must then provide the location of the correct libraries. For example, you can set the GDB_SHLIB_PATH environment variable to point to the correct directories.

    A core library mismatch can occur when a core file is produced on one computer and debugged on another.

    The libraries used by the executable when it produced the core file on one computer may not  be the same on another. Libraries that might cause this problem include libc,libm, etc. They may also include libraries specific to your executable. In these cases, debugging core files may produce wrong or inconsistent behavior such as truncated or missing stack trace, incorrect symbols, or incorrect data values.

  • Setting object file paths: The Object File Paths dialog box lets you enter paths so that WDB GUI can locate object files for the current program. In this dialog box, you can add, delete, and change the priority order of object file paths. You can access the Object File Paths dialog box on the Edit menu by clicking Object File Paths. Alternately, you may also set the object file paths from WDB GUI’s command view.

© 2004-2005 Hewlett-Packard Development Company, L.P.