pmap: use only address start to range determination

Fix to an edge case.  When user defined begining of address range to
be at between two allocations the previous allocation which ended to
that address was included to printout.  After this commit one will
see only allocations that are within range definition.

$ pmap -A00007f4e0df08000,00007f4e0df08000 895
895:   bash
00007f4e0dd08000   2048K -----  /lib/libreadline.so.6.2
00007f4e0df08000      8K r----  /lib/libreadline.so.6.2
 total             2056K

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-03-03 17:51:51 +01:00
parent ed57504c38
commit d5c760ee07

6
pmap.c
View File

@ -272,10 +272,10 @@ static int one_proc(proc_t * p)
&end, flags, &file_offset, &dev_major, &dev_minor,
&inode);
if (start > range_high)
break;
if (end < range_low)
if (end - 1 < range_low)
continue;
if (range_high < start)
break;
tmp = strchr(mapbuf, '\n');
if (tmp)