- 论坛徽章:
- 0
|
#include <stdio.h>
char arr[1024*10] = {0};
int main ()
{
arr[1024*10 -1] = 'c';
printf("arr:%p-%p\n", arr, &(arr[1024*10 - 1]));
return pause();
}
dev@ubuntu:~/test$ ./pause &
[1] 15652
dev@ubuntu:~/test$ arr:0x804a040-0x804c83f
dev@ubuntu:~/test$ ps
PID TTY TIME CMD
15375 pts/1 00:00:00 bash
15652 pts/1 00:00:00 pause
15653 pts/1 00:00:00 ps
dev@ubuntu:~/test$ pmap -d 15652
15652: ./pause
Address Kbytes Mode Offset Device Mapping
00110000 1356 r-x-- 0000000000000000 008:00001 libc-2.11.1.so
00263000 4 ----- 0000000000153000 008:00001 libc-2.11.1.so
00264000 8 r---- 0000000000153000 008:00001 libc-2.11.1.so
00266000 4 rw--- 0000000000155000 008:00001 libc-2.11.1.so
00267000 12 rw--- 0000000000000000 000:00000 [ anon ]
00492000 4 r-x-- 0000000000000000 000:00000 [ anon ]
00c2f000 108 r-x-- 0000000000000000 008:00001 ld-2.11.1.so
00c4a000 4 r---- 000000000001a000 008:00001 ld-2.11.1.so
00c4b000 4 rw--- 000000000001b000 008:00001 ld-2.11.1.so
08048000 4 r-x-- 0000000000000000 008:00001 pause
08049000 4 r---- 0000000000000000 008:00001 pause
0804a000 4 rw--- 0000000000001000 008:00001 pause
0804b000 8 rw--- 0000000000000000 000:00000 [ anon ]
b7785000 4 rw--- 0000000000000000 000:00000 [ anon ]
b7795000 12 rw--- 0000000000000000 000:00000 [ anon ]
bfe6a000 84 rw--- 0000000000000000 000:00000 [ stack ]
mapped: 1624K writeable/private: 132K shared: 0K
怎么显示我用的那块导致为anon? |
|