IBM Support

HOW TO PACKAGE CORE FILE, EXECUTABLE AND LIBS ON HP

Technical Blog Post


Abstract

HOW TO PACKAGE CORE FILE, EXECUTABLE AND LIBS 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. Sometimes it's no easy to identify what libraries or shared objects should be sent along with the core file.

 

On HP the 'gdb' port of HP has a command that will do it all for you, the 'packcore' command. You just need to specify the core file name and the output directory.

 

Example:

    # /opt/langtools/bin/gdb /u/dalla/t /u/dalla/core
    (gdb) packcore core /u/dalla
    Core was generated by `t'.
    Program terminated with signal 11, Segmentation fault.
    #0  0x4000000000001ebc in main+0x2c ()
    (gdb) q

    Then you can see the resulting file:

    # tar tvf /u/dalla/core.tar
    rwxrwxrwx 9711/1240  24752 Apr  5 18:52 2017 t
    r-xr-xr-x   2/2 390152 Jan 26 23:21 2005 dld.sl
    r-xr-xr-x   2/2 1860696 Jun 27 15:05 2003 libc.2
    r-xr-xr-x   2/2  15048 Jan 26 23:21 2005 libdl.1

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

UID

ibm13286437