Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)

For detailed information about debugging using RTC APIs, refer Debugging Dynamic Memory
Usage Errors Using HP WDB whitepaper at the HP WDB Documentation webpage at: http://
www.hp.com/go/wdb
Support for Memory debugging from Core File
HP WDB 6.4 and later versions support info heap/leak/danglingcommands for corefile
debugging if corefile is generated when application is running under BATCH mode with required
rtcconfig setting.
Following are the steps to run the above feature:
Run the application in batch mode and allow it to produce core file.
Examine this core file under debugger and issue RTC info commands (info
heap/leaks/corruption).
For detailed information refer “Debugging Memory from core file” section from white paper
Debugging Dynamic Memory Usage Errors Using HP WDB.
NOTE: RTC setting must not be done to gdb when analyzing the corefile. This feature is currently
supported only on HP Integrity systems.
Memory debugging without prior preparation
HP WDB on HP Integrity systems from version WDB-6.5 or later, supports basic leak or heap
memory reporting of a running process. This reporting does not make it mandatory for the users
to preload the librtc library before invoking the application, which was essential until HP WDB
6.4. This feature in conjunction with nudge triggered memory report generation introduced in WDB
6.4, empowers the users to obtain memory reports at any point of time during the execution of a
process without any prior preparation or environmental settings.
Following is the summary of steps that the user needs to follow:
HP WDB is attached to the running process to turn ON the dynamic-rtc feature and it is then
detached. It causes dynamic loading of librtc library and thus, memory monitoring.
The nudge signal to the process at any time after the feature is turned ON causes memory
report generation.
HP WDB is used to turn off the dynamic-rtc feature. Further, the process continues normally.
The following HP WDB command helps in turning this dynamic-rtc feature ON or OFF:
set dynamic-rtc [on/off]
The corresponding show command provides the present status.
This feature has some limitation. The memory heap or leak reports as obtained by this feature does
not provide a stack-trace for the blocks allocated before dynamic-rtc is turned on. If such prior
blocks were allocated with the same stack-trace, then they are not clubbed into a single entry.
For detailed information, see the section Memory debugging without prior preparation from the
whitepaper Debugging Dynamic Memory Usage Errors Using HP WDB.
NOTE: This feature is only available on HP Integrity systems. It requires PHCO_43464 or its
superseded libclibrary patch to be installed.
Open-files reporting
From version 6.2 onwards, HP WDB enables you to obtain a report containing a list of file
descriptors corresponding to files open by the application at the point of its exit. The report not
only provides you the names and types of those files, but also details such as backtraces and
function names at the point of the files being opened. This enables you to identify potential file
descriptor leaks in the application.
126 HP-UX Configuration-Specific Information