| 233 | } |
| 234 | |
| 235 | inline 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 | |
| 251 | inline std::size_t source_line(const void* addr, bool position_independent) { |
| 252 | std::size_t line_num = 0; |
no test coverage detected