| 164 | typedef to_string_impl_base<to_string_using_backtrace> to_string_impl; |
| 165 | |
| 166 | inline std::string name_impl(const void* addr) { |
| 167 | std::string res; |
| 168 | |
| 169 | boost::stacktrace::detail::program_location prog_location; |
| 170 | ::backtrace_state* state = boost::stacktrace::detail::construct_state(prog_location); |
| 171 | |
| 172 | boost::stacktrace::detail::pc_data data = {&res, 0, 0}; |
| 173 | if (state) { |
| 174 | ::backtrace_pcinfo( |
| 175 | state, |
| 176 | reinterpret_cast<uintptr_t>(addr), |
| 177 | boost::stacktrace::detail::libbacktrace_full_callback, |
| 178 | boost::stacktrace::detail::libbacktrace_error_callback, |
| 179 | &data |
| 180 | ) |
| 181 | || |
| 182 | ::backtrace_syminfo( |
| 183 | state, |
| 184 | reinterpret_cast<uintptr_t>(addr), |
| 185 | boost::stacktrace::detail::libbacktrace_syminfo_callback, |
| 186 | boost::stacktrace::detail::libbacktrace_error_callback, |
| 187 | &data |
| 188 | ); |
| 189 | } |
| 190 | if (!res.empty()) { |
| 191 | res = boost::core::demangle(res.c_str()); |
| 192 | } |
| 193 | |
| 194 | return res; |
| 195 | } |
| 196 | |
| 197 | } // namespace detail |
| 198 |
nothing calls this directly
no test coverage detected