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

Function source_file

include/boost/stacktrace/detail/addr2line_impls.hpp:235–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235inline std::string source_file(const void* addr, bool position_independent) {
236 std::string res;
237 uintptr_t addr_base = 0;
238 if(position_independent){
239 addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr);
240 }
241 const void* offset = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(addr) - addr_base);
242 res = boost::stacktrace::detail::addr2line("-e", offset);
243 res = res.substr(0, res.find_last_of(':'));
244 if (res == "??") {
245 res.clear();
246 }
247
248 return res;
249}
250
251inline std::size_t source_line(const void* addr, bool position_independent) {
252 std::size_t line_num = 0;

Callers 2

frameClass · 0.85
source_fileMethod · 0.85

Calls 2

addr2lineFunction · 0.85
get_own_proc_addr_baseFunction · 0.70

Tested by

no test coverage detected