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

Summary of Changes in WDB 5.2

» 

Technical documentation

Complete book in PDF

 » Table of Contents

WDB 5.2 includes the following enhancements and defect fixes:

  • Enhanced inline support:

    WDB 5.2 (and later) provides improved support for debugging inlined functions in applications compiled with -g, without needing the +d option to disable inlining. This support is enabled for PA-RISC applications compiled with +inline_debug option, added in the A.03.65 HP aC++ compiler. Itanium applications compiled with -g by the A.06.02 (and later) compilers support this feature with no additional option needed. Set inline-debug on at gdb command prompt to enable debugging of inlined code. You can also use -inline option when starting up the gdb to enable this. By default, debugging of inlined code is disabled in gdb 5.2.(gdb) set inline-debug onor

    $ gdb --inline a.out
    NOTE: For PA, the current implementation will not support stepping into any function inlined through an implicit call.

    The following commands have been added to enhance inline support for applications compiled with +O1 -g option:

    • step

    • next

    • list

    • backtrace

    • frame <n>

    • info locals

    • info args

    The +d option, to disable inlining need not be used.The following commands do not work with inlined functions:

    • breakpoint

    • info frame

    • disassembly

  • WDB supports a new -mapshared option:

    Implemented the -mapshared option to suppress mapping all shared libraries in a process private. This option enables new facilities in the dynamic loader (patch PHSSS_33110 or later) to designate individual shared libraries for debugging. By default, HP WDB instructs the shared library dynamic loader, dld.sl(5), to map shared libraries in a process private, regardless of whether the chatr command is run for a particular shlib with +dbg or not.

    The -mapshared option is used to save virtual memory for debugging applications with large amounts of code in shared libraries, on machines with simultaneous debug sessions. The chatr+dbg option, and the _HP_DLDOPTS environment variable are used to identify shared libraries for debugging. The -mapshared option ensures that the text segments of all other shared libraries is shared across the system. The shared libraries are not mapped private and cannot have breakpoints in them.

    The set mapshared on command can be used to change modes from the (gdb) prompt.

    (gdb) set mapshared on 

    The set mapshared off command can be used to load shared libraries after the current point is mapped private.

    (gdb) set mapshared off 

    The -mapshared option is implemented on both PA-RISC and Itanium platforms in HP WDB 5.2. This option is provided in the WDB GUI, wdb(1), as well as HP WDB, gdb(1). The default behavior does not change if the -mapshared option for all shared libraries in processes started under the debugger, (or dynamically loaded after an attach) are mapped private.

  • New command watch_target:

    The watch_target command takes an expression as an argument, evaluates it to an address, and watches the target of that address.

    For example:

    (gdb) watch_target current_frame 

    This is equivalent to executing:

    (gdb) print current_frame$1 = (struct frame_info *) 0x7fdf78(gdb) watch *(struct frame_info *) 0x7fdf78
  • Support for __fpreg data type on IPF:

    WDB internally converts this data type into a long double data type, to evaluate an expression or print the value of the expression. Since long double has only 15 bit exponent as opposed to 17 bit exponent of __fpreg, precision is lost when the exponent is larger than that can fit in 15 bits.

  • Support for hardware breakpoints on IPF:

    The hbreak command sets hardware assisted breakpoints.

    hbreak args

    The arguments (args) is same as that for the break command and the breakpoint is set in the same way. However, the breakpoint uses hardware assisted breakpoint registers. There are only 2 hardware breakpoints that can be set on IPF. This is useful in ROM code debugging and shared library debugging for libraries, including dld, that are not loaded private.

    The normal breakpoints are converted to a hardware breakpoint when WDB cannot set a normal breakpoint in the shared library.

  • Enhanced info symbol ADDRESS command:

    The info symbol command has been enhanced to search the stack for a symbol at the given address. Previously, the info symbol command could be used only to search the global namespace.

  • New command info module ADDRESS:

    The info corruption command can detect memory corruption in an application. That is, it reports all the memory blocks that have over-writes and under-writes.

    Syntax:

    info corruption [<file name>]

    The run time memory checking must be enabled before using info corruption command to detect memory corruption.The corruption information is written to a file specified in the file name argument if provided. Otherwise, it is printed to the stdout.

  • New command show envvars:

    The show envvars command prints information on environment variables supported by WDB.

    Syntax:

    show envvars
  • New command info corruption:

    The info corruption command can detect memory corruption in an application.

    Syntax :

    info corruption <file name>

    The run time memory checking must be enabled before using info corruption command to detect memory corruption.

    The corruption information is written to the file specified in the file name argument.

  • Enhanced nexti and stepi commands:

    During instruction level stepping with nexti and stepi, WDB now prints the assembly instruction along with the next source line.

    (gdb) stepi0x101530:0 st4 [r9]=r341337 args.argc = argc;

    It also prints DOC line information, which includes actual line number and the column number, when debugging a -g -O binary.

    (gdb) stepi;;; [8, 1]0x4000820:1 nop.m 0x0
  • New option +check:

    The HP aC++ compiler supports a new option +check. The +check option can be used to invoke batch RTC to determine run time memory problems. For more information on the +check option refer to HP aC++ Release Notes.

  • Enhanced batch RTC support:

    The batch RTC support in WDB has been enhanced to support better reporting, and old options have replaced with new ones.

    The enhancements to the batch RTC support are:

    • Memory corruption events written to <a.out>.<pid>.mem file.

    • New environment variable RTC_MALLOC_CONFIG: RTC_MALLOC_CONFIG=config_string1[;config_strings]. Specify config_string for +check=malloc or wdb memory check batch mode. This overwrites the default config and rtcconfig file settings. The config strings are separated by ;

    • Added new config_ strings:

      Table 1-1 New config_string

      config_stringsDescription
      abort_on_bounds=[01]Aborts execution when heap objects bounds check fail, value is 1, and RTC_NO_ABORT is not set
      abort_on_bad_free=[01]Aborts execution when free or realloc a non valid heap object, value is 1, and the environment variable RTC_NO_ABORT is not set
      abort_on_nomem=[01]Abort execution when out of memory if value is 1, and RTC_NO_ABORT is not set

      leak_logfile=stderr[+]filename

      mem_logfile=stderr[+]filename

      heap_logfile=stderr[+]filename

      Specify the log file for batch mode.

      here:

      stderr: error message goes to stderr

      [+]filename: error message goes to filename, + means output is appended to the file

       

    • The batch rtc mode continues to run if the environment variable RTC_NO_ABORT is set.

    • The batch mode can be enabled using IPF C and C++ compiler option +check=malloc. For more information refer to HP C/HP aC++ Release Notes.

    • The BATCH_RTC environment variable valid values have been changed from BATCH_RTC=1|0 to BATCH_RTC=on|off.

    NOTE: A detailed section on WDB support of debugging optimized code has been added to the user manual.
  • Support for deferred breakpoints on a dlopened and shl_loaded libraries with stripped main program:

    WDB triggers deferred breakpoints on dlopened and shl_loaded libraries for PA 32-bit applications with striped main program. This support is available for PA 64-bit and IPF applications.

  • Support for Debugging PA-RISC Applications on Itanium-based Systems:

    This feature supports debugging PA-RISC applications and core files on Itanium-based systems in compatibility mode under Aries. Loading a PA executable on IPF system, and the debug target being a PA-RISC binary, the PA version of WDB is invoked.

    For example:

    $ gdb ./a.out

    where a.out file is a PA binary. When this command is run, the PA version of WDB is invoked on the IPF system. Debugging the PA binary on IPF, involves the following steps:

    • setting the PA_DEBUG environment variable to 1.

    • setting the SHELL environment variable to a PA shell.

    The PA shell is required as WDB on PA invokes it in order to parse any argument passed to the debugged application. Any shell from a PA system can be copied over to IPF systems for this purpose. All the features of WDB on PA are supported on IPF on Aries. However, the support for MxN debug capabilities of WDB on PA will be discontinued on Aries. On HP-UX IPF systems, PA version of WDB is packaged under /usr/ccs/bin. The PATH environment variable must include the /usr/ccs/bin directory.

  • Enhanced commands for core files:

    WDB 5.2 introduces a set of commands for the following operations on core files:

    • Saving a core file and related information.

    • Examining the core file on a system other than the one on which the core file was created or updated.

    The following new commands have been added:

    • packcore: This creates a file with information about the executable and the core file being examined (e.g. packcore.tar.Z). Syntax:

      packcore [ basename ]

    • unpackcore: The unpackcore command unpacks the file made by packcore and loads the executable and the core file with GDB_SHLIB_PATH to allow backtrace and other commands to examine the core file.

      Syntax:

      unpackcore [ packore_file ] [ core_file ]
    • getcore: The getcore command can be used to examine a core file in a directory previously created by unpackcore.

      Syntax:

      getcore [ packcore_directory ]
  • Enhanced Java debugging support:

    The following commands have been added to enhance Java debugging support:

    Table 1-2 Enhancements to Java Debugging Support

    CommandDescription
    backtracePrints backtrace of mixed java and native frames. Standard backtrace command of gdb has been enhanced to work with the mixed java and native stack frames.
    info framePrints Java frame specific information for a Java frame. Standard frame command of gdb has been enhanced to interpret a java stack frame.
    info threadsPrints state information for all Java threads.
    threadPrints detailed state information for the current Java thread.

     

  • New commands for examining Java Virtual Machine ( JVM ) internals:

    The following commands can be used to obtain information on Java VM internals:

    Table 1-3 Commands to obtain information on Java VM internals

    CommandDescription
    help javaPrints list of Java and JVM debugging commands
    javaPrints list of java subcommands

     

  • New Java subcommands:

    The following Java subcommands have been added:

    Table 1-4 Java Subcommands

    SubcommandDescription
    java args <frame-number>Prints the current or specified Java frame arguments information
    java bytecodes <methodOop>Disassembles the given Java method bytecode
    java heap-histogramDisplays the Java heap object histogram
    java instances <klassOop>Locates the instances of the given klassOop in the Java heap
    java jvm-statePrints current status of Java virtual machine internal states
    java localsPrints current or specified Java frame locals information
    java mutex-infoPrints details of the static mutexes
    java object <object-ptr>Prints the given Java object field information
    java oop <Java_heap_address>Locates Java object oop of the given Java heap address
    java references <oop>Locates references to the given Java object in the Java heap
    java unwind-info <pc>Prints unwind information of the code where the given PC is located
    java unwind-tablePrints the dynamically generated Java Unwind Table

     

  • Support for stop in/at dbx commands:

    The commands <stop in function/address> and <stop at line> are the dbx equivalent of <break function/address/line> command. WDB supports the <stop in/at> command in non-dbx mode.

    For example :

    $ gdb a.out(gdb) stop in mainBreakpoint 1 at 0x2a34: file list.c, line 18 from /tmp/a.out.(gdb) stop at 25Breakpoint 2 at 0x2a6c: file list.c, line 25 from /tmp/a.out.(gdb)
  • Support for GNU GDB logging commands:

    The following new commands have been added:

    Table 1-5 GNU GDB Logging Commands

    CommandDescription
    set logging fileSet the current logfile
    set logging offSet logging off
    set logging onSet logging on
    set logging overwrite[on|off]Set whether logging overwrites or appends to the log file
    set logging redirect [on|off]Set the logging output mode

     

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