From: Sami Kerola Date: Sat, 3 Mar 2012 16:51:51 +0000 (+0100) Subject: pmap: use only address start to range determination X-Git-Tag: v3.3.3~33^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5c760ee07d5f2f7d6e5bd78c79e48e74ed276b3;p=procps-ng 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 --- diff --git a/pmap.c b/pmap.c index b04b521b..3ba1bfe3 100644 --- a/pmap.c +++ b/pmap.c @@ -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)