Debugging with GDB Manual (5900-1473; WDB 6.2; January 2011)

Table Of Contents
mmapfile = testfile can not be added
Specifying an unknown file, or providing an incomplete or wrong command reports
appropriate error messages.
(gdb) mmapfile xyz 0x60000000c1a91000 0 0xe1
mmapfile = xyz can not be opened (errno = 2)
(gdb) mmapfile testfile 0x60000000c1a91000
Usage:
mmapfile <FILENAME> <MAP-ADDRESS> <FILE-OFFSET> <LENGTH>
14.16 Debugging with debug information available in the side debug file
HP-UX/Integrity linker version B.12.56 onwards, includes an option +dbgfile <path>.
This option instructs the linker to emit debug information separately to the file specified
in path, instead of the target (executable or shared library) file as by default. The linker
also records the name of this debug information file, along with a checksum, in a special
section named .gnu_debuglink, in the target file. The rest of this document refers this
debug information file as side debug file. HP WDB version 6.2 onwards recognizes this
special section and will read in the debug information from the file.
This feature is intended to be used for reducing the size of the executable file. On HP-UX,
ILP32 objects are ELF32 files and hence the size of the executable is limited to 4 GB.
The new linker emits an error message if the target file size exceeds this limit. For debug
builds, the default +objdebug compilation can help in keeping the debug information
out of the executable. When +objdebug is not preferred, this new linker option can be
used to keep the target file size under the 4 GB limit.
By default, the linker creates an ELF32 debug information file in ILP32 links and ELF64
for LP64 links. If the debug information is too large to fit in an ELF32 file, the linker emits
an error message indicating this. In such a case, the new +dbgfile <path> can be
used, so that the linker creates an ELF64 side debug file even for an ILP32 link. The newly
enhanced HP WDB can handle this combination of ELF32 executable file and ELF64
side debug file.
To use the side debug file feature on HP-UX/Integrity, follow these steps:
For generating a side debug file which is contained in ELF32 image, use the linker
option +dbgfile side_file_name, where, the side_file_name is the file name
of the side debug file. For generating a side debug file which is in ELF64 binary,
use the linker option +dbgfile-large side_file_name. You can use this
option even when the actual executable is in ELF32 container.
Invoke gdb on the executable to start debugging the application. The debugger will
read in the debug information automatically from the side file generated by linker.
By default, the debugger searches for the debug file in the following locations:
14.16 Debugging with debug information available in the side debug file 203