HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 62 (of 101)
Chapter 11 Software Development
October 29, 2013
MMAP 0xd22f400.0x000000006ffe6000 1 4 3 5
MMAP 0xd22f400.0x000000006ffea000 1 2 2 3
SHLDATA 0xd22f400.0x000000006ffec000 1 4 4 5
STACK 0xd22f400.0x000000006fff0000 1 528 272 530
SHLTEXT 0x7082400.0x00000000c0004000 109 3 3 1
SHLTEXT 0x7082400.0x00000000c0010000 117 33 33 1
:
kmeminfo prints one line for each memory region. Most interesting are columns 1, 3 and 5.
Column 1 tells what the region is used for. The abbreviations are self-explaining. Column 3 lists
the start address and column 5 its size in pages (one page = 4k).
kmeminfo reads the kernel memory so you need to be root to use it. Another way would be to set
the set-user-ID permission flag of the root owned kmeminfo executable with chmod(1). Detailed
information on kmeminfo is available at
http://ktools.hp.com/~hpux/kmeminfo/
This tool is not officially available but can be sent out to customers on request. It can be obtained
from the KTOOLS website [8].
adb(1)
When analyzing a core file with gdb, adb can provide additional, helpful information. E.g. to
find out if a pointer or address found in gdb is valid, and to which region it belongs, the $m
command of adb can print the address map of the aborted program.
The easiest way to get an address map is to pipe the $m command into adb. Make sure to
surround the $m with single quotes, else the shell would interpret it as shell variable and replace it
with whatever is in its variable $m:
$ echo $m | adb a.out core
:
Data: b = 40001000 e = 40008000 f = 56C
MMF: b = 7AEE9000 e = 7AEEA000 f = 757C
MMF: b = 7AEEA000 e = 7AEEB000 f = 858C
:
MMF: b = 7B04E000 e = 7B050000 f = 16C60C
MMF: b = 7B050000 e = 7B054000 f = 16E61C
Stack: b = 7F7F0000 e = 7F7F8000 f = 17262C
:
For each region it prints its type, and the start and end address. This is similar to the output of
kmeminfo pid. gdb’s info target command also lists the address space, but in much more
detail which makes it more difficult to read.