source: XIOS3/trunk/extern/cpptrace/src/unwind_with_winapi.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: 580 bytes
Line 
1#ifdef CPPTRACE_UNWIND_WITH_WINAPI
2
3#include "cpptrace.hpp"
4#include "unwind.hpp"
5#include "common.hpp"
6
7#include <vector>
8
9#include <windows.h>
10
11namespace cpptrace {
12    namespace detail {
13        CPPTRACE_FORCE_NO_INLINE
14        std::vector<void*> capture_frames(size_t skip) {
15            std::vector<PVOID> addrs(hard_max_frames, nullptr);
16            int frames = CaptureStackBackTrace(static_cast<DWORD>(skip + 1), hard_max_frames, addrs.data(), NULL);
17            addrs.resize(frames);
18            addrs.shrink_to_fit();
19            return addrs;
20        }
21    }
22}
23
24#endif
Note: See TracBrowser for help on using the repository browser.