darfink / region-rs

A cross-platform virtual memory API written in Rust
https://darfink.github.io/region-rs/
MIT License
119 stars 23 forks source link

Please make the name/description of the region available #26

Open teythoon opened 12 months ago

teythoon commented 12 months ago

For example, on Linux I see:

% cat /proc/self/maps
5560a8b9d000-5560a8b9f000 r--p 00000000 fd:01 5637877                    /usr/bin/cat
5560a8b9f000-5560a8ba4000 r-xp 00002000 fd:01 5637877                    /usr/bin/cat
5560a8ba4000-5560a8ba7000 r--p 00007000 fd:01 5637877                    /usr/bin/cat
5560a8ba7000-5560a8ba8000 r--p 00009000 fd:01 5637877                    /usr/bin/cat
5560a8ba8000-5560a8ba9000 rw-p 0000a000 fd:01 5637877                    /usr/bin/cat
5560aa060000-5560aa081000 rw-p 00000000 00:00 0                          [heap]
7f650ca00000-7f650cce9000 r--p 00000000 fd:01 5640853                    /usr/lib/locale/locale-archive
7f650cd10000-7f650cd35000 rw-p 00000000 00:00 0 
7f650cd35000-7f650cd5b000 r--p 00000000 fd:01 5661641                    /usr/lib/x86_64-linux-gnu/libc.so.6
7f650cd5b000-7f650ceb0000 r-xp 00026000 fd:01 5661641                    /usr/lib/x86_64-linux-gnu/libc.so.6
7f650ceb0000-7f650cf03000 r--p 0017b000 fd:01 5661641                    /usr/lib/x86_64-linux-gnu/libc.so.6
7f650cf03000-7f650cf07000 r--p 001ce000 fd:01 5661641                    /usr/lib/x86_64-linux-gnu/libc.so.6
7f650cf07000-7f650cf09000 rw-p 001d2000 fd:01 5661641                    /usr/lib/x86_64-linux-gnu/libc.so.6
7f650cf09000-7f650cf16000 rw-p 00000000 00:00 0 
7f650cf33000-7f650cf35000 rw-p 00000000 00:00 0 
7f650cf35000-7f650cf36000 r--p 00000000 fd:01 5661637                    /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7f650cf36000-7f650cf5b000 r-xp 00001000 fd:01 5661637                    /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7f650cf5b000-7f650cf65000 r--p 00026000 fd:01 5661637                    /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7f650cf65000-7f650cf67000 r--p 00030000 fd:01 5661637                    /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7f650cf67000-7f650cf69000 rw-p 00032000 fd:01 5661637                    /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7ffd0d8aa000-7ffd0d8cb000 rw-p 00000000 00:00 0                          [stack]
7ffd0d9bf000-7ffd0d9c3000 r--p 00000000 00:00 0                          [vvar]
7ffd0d9c3000-7ffd0d9c5000 r-xp 00000000 00:00 0                          [vdso]

Would be nice if the information right-most column ('/usr/bin/cat', '[heap]', or '[stack]') would be preserved and made available.