NOTE: Following are different ways of representing the /size-charand /max-countparameters:

/1b

/b1

/b /1

/1 /b

where:

1Specifies that find must display 1 matching pattern. b Specifies that the size of the pattern is 8 bits.

14.15Debugging Core Files

14.15.1 Generating core files with packcore /unpackcore/getcore

The contents of a core file can be viewed only on a system which has all the shared libraries that were in use on the system on which the core file was generated. If you want to view the content of the core file on a system which does not have the shared libraries, you have to set the environment variables GDB_SHLIB_PATH or GDB_SHLIB_ ROOT to make it search for the desired libraries. The commands packcore, unpackcore, and core simplify the process of examining the contents of a core file on a system other than the one in which it was generated.

The packcore command is used on the system which generated the core file. When you are examining the core file on the original system, you can execute packcore to make a packcore.tar.Z file. This is a compressed tar file which contains the core file, the executable, and all the shared libraries that were used by the program when it generated the core file. The core file is removed after it is added to the packcore.tar.Z file.

The packcore command has one optional argument, basename, which can be used instead of packcore to make packcore.tar.Z.

The packcore.tar.Z file can be copied to a different system and the gdb command unpackcore unpacks the packcore.tar.Z file in the current directory, creating a new packcore directory. After unpacking the packcore file, the unpackcore command invokes getcore to load the executable and the core file from the packcore directory, and sets GDB_SHLIB_PATH to the modules directory in the packcore directory. The modules directory holds all of the shared libraries that were used when the core file was generated.

The unpackcore command has two optional arguments. The first defaults to packcore.tar.Z and is the name of the packcore file to be unpacked. The second argument is given if the core file is too large to fit in the packcore file. It is the path to

200 HP-UX Configuration-Specific Information