| 207 | typedef to_string_impl_base<to_string_using_addr2line> to_string_impl; |
| 208 | |
| 209 | inline std::string name(const void* addr, bool position_independent) { |
| 210 | uintptr_t addr_base = 0; |
| 211 | if(position_independent){ |
| 212 | addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr); |
| 213 | } |
| 214 | const void* offset = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(addr) - addr_base); |
| 215 | std::string res = boost::stacktrace::detail::addr2line("-fe", offset); |
| 216 | res = res.substr(0, res.find_last_of('\n')); |
| 217 | res = boost::core::demangle(res.c_str()); |
| 218 | |
| 219 | if (res == "??") { |
| 220 | res.clear(); |
| 221 | } |
| 222 | |
| 223 | return res; |
| 224 | } |
| 225 | |
| 226 | inline std::string name_impl(const void* addr) { |
| 227 | std::string res = boost::stacktrace::detail::name(addr, false); |
no test coverage detected