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

Function name_impl

include/boost/stacktrace/detail/libbacktrace_impls.hpp:166–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164typedef to_string_impl_base<to_string_using_backtrace> to_string_impl;
165
166inline 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

Callers

nothing calls this directly

Calls 2

construct_stateFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected