source: XIOS3/trunk/extern/cpptrace/src/full_trace_with_stacktrace.cpp @ 2573

Last change on this file since 2573 was 2573, checked in by ymipsl, 9 months ago

create new external source lib : cpptrace, for statck trace output
YM

File size: 779 bytes
Line 
1#ifdef CPPTRACE_FULL_TRACE_WITH_STACKTRACE
2
3#include "cpptrace.hpp"
4#include "full_trace.hpp"
5#include "common.hpp"
6
7#include <vector>
8#include <stacktrace>
9
10namespace cpptrace {
11    namespace detail {
12        CPPTRACE_FORCE_NO_INLINE
13        std::vector<stacktrace_frame> generate_trace(size_t skip) {
14            std::vector<stacktrace_frame> frames;
15            std::stacktrace trace = std::stacktrace::current(skip + 1);
16            for(const auto entry : trace) {
17                frames.push_back({
18                    entry.native_handle(),
19                    entry.source_line(),
20                    0,
21                    entry.source_file(),
22                    entry.description()
23                });
24            }
25            return frames;
26        }
27    }
28}
29
30#endif
Note: See TracBrowser for help on using the repository browser.