https://github.com/joaomlneto/procmap
C++ wrapper around /proc/self/maps
https://github.com/joaomlneto/procmap
cpp cpp-lib cpp-libraries cpp-library cpp14 library linux mapping memory memory-allocation memory-allocations memory-analysis memory-management memory-mapping memory-monitor memory-monitoring process wrapper wrapper-functions wrapper-library
Last synced: 2 months ago
JSON representation
C++ wrapper around /proc/self/maps
- Host: GitHub
- URL: https://github.com/joaomlneto/procmap
- Owner: joaomlneto
- License: mit
- Created: 2018-11-05T18:25:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-14T12:20:51.000Z (about 5 years ago)
- Last Synced: 2025-04-01T19:19:10.823Z (3 months ago)
- Topics: cpp, cpp-lib, cpp-libraries, cpp-library, cpp14, library, linux, mapping, memory, memory-allocation, memory-allocations, memory-analysis, memory-management, memory-mapping, memory-monitor, memory-monitoring, process, wrapper, wrapper-functions, wrapper-library
- Language: C++
- Homepage:
- Size: 21.5 KB
- Stars: 15
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.com/joaomlneto/procmap)
# procmap
A simple C++ wrapper around `/proc/self/maps`This tool makes it simpler to help visualize the memory map of your process.
It's super simplistic and was created to suit my own needs. Hopefully it provides a good start for you and you'll enhance it with a few more options (and submit a PR!) :-)
## Examples
### Reading `/proc/self/maps`
Couldn't be easier.
```cpp
MemoryMap m;
```### Visualizing `/proc/self/maps`
```cpp
MemoryMap m;
m.print();
```
### Iterating through the entries and selecting only those that are writeable
```cpp
MemoryMap map;
for (auto &segment : map) {
if (segment.isWriteable()) {
segment.print();
}
}
```
## Reference
MemoryMap is basically a collection of MemorySegments. Use it as you would a `std::vector`.
MemorySegment represents a single entry/line in `/proc/*/maps`. It provides a plethora of utility functions to make life more pleasant. Check the [header file](https://github.com/joaomlneto/process-memory-map/blob/master/include/procmap/MemorySegment.hpp) for a complete list.
## Suggestions / Complaints
Open an issue! :-)## Contributing
PRs are more than welcome.