Technical Blog Post
Abstract
HOW TO LOAD A CORE FILE ON HP
Body
A core file is the image of a process' memory but does not contain some of the information a debugger needs to work properly. Some of those information are for example the 'symbol table' and the 'instructions'.
Both executable and loaded objects (dynamic libraries) have each their own set of instructions and symbols. The libraries, especially system ones, used by the process on the machine where the core file comes from might be different from the ones used on the machine where the core file is to be analyzed. As well the path of those libraries might be different on both machines.
For the debugger to work properly the core file, the executable but also all the loaded objects from the original machine should be copied to the machine where the core file is to be examined. Then some extra steps are required to let the debugger know where to find those original libraries and objects.
The common debugger used on HP is HP's own port of 'gdb' located in '/opt/langtools/bin/gdb'.
To indicate to the debugger where the 'original' libraries and objects are located you must use the environment variable 'GDB_SHLIB_ROOT'. This variable indicates where the '/' from the original machine should be found on the local machine.
Example:
[/home/dalla/CORE1] ls -l
-rwxr-xr-x 1 dbguest0 pdxdb2 1019432 Mar 20 11:30 myexec
drwxr-xr-x 3 dbguest0 pdxdb2 96 Apr 19 19:04 db2
-rw-r----- 1 26381 pdxdb2 21568800 Apr 19 19:07 mycore
drwxr-xr-x 3 dbguest0 pdxdb2 96 Apr 19 19:04 opt
drwxr-xr-x 3 dbguest0 pdxdb2 96 Apr 19 19:04 usr
[/home/dalla/CORE1] GDB_SHLIB_ROOT=`pwd`
[/home/dalla/CORE1] export GDB_SHLIB_ROOT
[/home/dalla/CORE1] gdb ./myexec mycore
UID
ibm13286443