|
|
To display the contents of the memory maps, use the
$m
command.
The command has the following form:
$m [ segment ]
In the above command line segment is the number of a segment used in the program.
The command displays the maps for all segments in the program using information taken from either the program and core files or directly from memory.
If adb is started but the program has not executed, the $m command display has the following form:
Text Segments File - 'sample' Seg # File Pos Vir Size Phys Size Reloc Base 0x3f 0x400 0xb48 0xb48 0x0Each entry provides the segment number, file position, and physical size of a segment. The segment number is the starting address of the segment. The file position is the offset from the start of the file to the contents of the segment. The physical size is the number of bytes the segment occupies in the program or core file. The filenames to the right of the display are the program and core filenames.Data Segments File - 'sample' Seg # File Pos Vir Size Phys Size Reloc Base 0x47 0x1000 0xe90 0x460 0x1880000
If the program is executed, the command displays the following form:
Text Segments File - 'sample' Seg # File Pos Vir Size Phys Size Reloc Base 0x3f 0x400 0xb48 0xb48 0x0Virtual size is the number of bytes the segment occupies in memory. This size is sometimes different from the size of the segment in the file and will often change as the program is executed. This is due to expansion of the stack or allocation of additional memory during program execution. The filenames to the right always name program files. The file position value is ignored.Data Segments File - 'sample' Seg # File Pos Vir Size Phys Size Reloc Base 0x47 0x1000 0x1880e90 0x460 0x1880000
By providing a segment number with the command, adb displays information only about that segment. For example, the following command displays a map for segment 63 only:
$m 63