Debugging Core Files Using HP WDB (5900-1573; WDB 6.2; January 2011)
Following are examples that illustrate the gdb command-line options for invoking gdb
on a core file:
1. Invoke gdb on a core file generated when running a 32-bit Java application on an
Integrity system with /opt/java1.4/bin/java:
$ gdb /opt/java1.4/bin/IA64N/java core.java
2. Invoke gdb on a core file generated when running a 64-bit Java application on an
Integrity system with /opt/java1.4/bin/java -d64:
$ gdb /opt/java1.4/bin/IA64W/java core.java
3. Invoke gdb on a core file generated when running a 32-bit Java application on
PA-RISC using /opt/java1.4/bin/java:
$ gdb /opt/java1.4/bin/PA_RISC2.0/java core.java
4. Invoke gdb on a core file generated when running a 64-bit Java application on
PA-RISC using /opt/java1.4/bin/java:
$ gdb /opt/java1.4/bin/PA_RISC2.0W/java core.java
When debugging a core file, it is good practice to rename the file from core to another
name to avoid accidentally overwriting it.
If the Java and system libraries used by the failed application reside in non-standard
locations, then the GDB_SHLIB_PATH environment variable must be set to specify the
location of the libraries.
Support for mmapfile command
HP-UX does not include mmap-ed regions with MAP_SHARED mappings or MAP_PRIVATE
with Read-Only permission in core. Due to this, any references to this mmap-ed regions
cannot be debugged as the memory image of this region is unavailable to GDB. To solve
this problem, GDB version 6.2 onwards provides a mmapfile command. You can use
this command to add mmap-ed sections while debugging core files. You can do this
during the debug session of the core file, which will help you debug using the memory
contents from the missing mmap-ed regions in core file. Example 7 illustrates the usage
of the mmapfile command in GDB.
The mmapfile command is currently supported only on HP Integrity systems.
36