MCPcopy Create free account
hub / github.com/boostorg/stacktrace / get_own_proc_addr_base

Function get_own_proc_addr_base

include/boost/stacktrace/detail/addr_base.hpp:76–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76inline uintptr_t get_own_proc_addr_base(const void* addr) {
77 std::ifstream maps_file("/proc/self/maps");
78 for (std::string line; std::getline(maps_file, line); ) {
79 const mapping_entry_t mapping = parse_proc_maps_line(line);
80 if (mapping.contains_addr(addr)) {
81 return mapping.start - mapping.offset_from_base;
82 }
83 }
84 return 0;
85}
86
87}}} // namespace boost::stacktrace::detail
88

Callers 4

source_locationFunction · 0.70
nameFunction · 0.70
source_fileFunction · 0.70
source_lineFunction · 0.70

Calls 2

parse_proc_maps_lineFunction · 0.85
contains_addrMethod · 0.80

Tested by

no test coverage detected