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

Method source_file

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

Source from the content-addressed store, hash-verified

197} // namespace detail
198
199std::string frame::source_file() const {
200 std::string res;
201
202 if (!addr_) {
203 return res;
204 }
205
206 boost::stacktrace::detail::program_location prog_location;
207 ::backtrace_state* state = boost::stacktrace::detail::construct_state(prog_location);
208
209 boost::stacktrace::detail::pc_data data = {0, &res, 0};
210 if (state) {
211 ::backtrace_pcinfo(
212 state,
213 reinterpret_cast<uintptr_t>(addr_),
214 boost::stacktrace::detail::libbacktrace_full_callback,
215 boost::stacktrace::detail::libbacktrace_error_callback,
216 &data
217 );
218 }
219
220 return res;
221}
222
223std::size_t frame::source_line() const {
224 if (!addr_) {

Callers

nothing calls this directly

Calls 1

construct_stateFunction · 0.85

Tested by

no test coverage detected