| 49 | |
| 50 | |
| 51 | struct this_thread_frames { // struct is required to avoid warning about usage of inline+BOOST_NOINLINE |
| 52 | BOOST_NOINLINE BOOST_STACKTRACE_FUNCTION static std::size_t collect(native_frame_ptr_t* out_frames, std::size_t max_frames_count, std::size_t skip) noexcept; |
| 53 | |
| 54 | BOOST_NOINLINE static std::size_t safe_dump_to_impl(void* memory, std::size_t size, std::size_t skip) noexcept { |
| 55 | using boost::stacktrace::detail::native_frame_ptr_t; |
| 56 | |
| 57 | if (size < sizeof(native_frame_ptr_t)) { |
| 58 | return 0; |
| 59 | } |
| 60 | |
| 61 | native_frame_ptr_t* mem = static_cast<native_frame_ptr_t*>(memory); |
| 62 | const std::size_t frames_count = boost::stacktrace::detail::this_thread_frames::collect(mem, size / sizeof(native_frame_ptr_t) - 1, skip + 1); |
| 63 | mem[frames_count] = 0; |
| 64 | return frames_count + 1; |
| 65 | } |
| 66 | |
| 67 | template <class T> |
| 68 | BOOST_NOINLINE static std::size_t safe_dump_to_impl(T file, std::size_t skip, std::size_t max_depth) noexcept { |
nothing calls this directly
no outgoing calls
no test coverage detected