forked from jeremy-rifkin/cpptrace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunwind.hpp
More file actions
42 lines (33 loc) · 1007 Bytes
/
unwind.hpp
File metadata and controls
42 lines (33 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef UNWIND_HPP
#define UNWIND_HPP
#include <cpptrace/basic.hpp>
#include <cstddef>
#include <vector>
#ifdef CPPTRACE_UNWIND_WITH_DBGHELP
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
CPPTRACE_BEGIN_NAMESPACE
namespace detail {
#ifdef CPPTRACE_HARD_MAX_FRAMES
constexpr std::size_t hard_max_frames = CPPTRACE_HARD_MAX_FRAMES;
#else
constexpr std::size_t hard_max_frames = 400;
#endif
#ifdef CPPTRACE_UNWIND_WITH_DBGHELP
CPPTRACE_FORCE_NO_INLINE
std::vector<frame_ptr> capture_frames(
std::size_t skip,
std::size_t max_depth,
EXCEPTION_POINTERS* exception_pointers = nullptr
);
#else
CPPTRACE_FORCE_NO_INLINE
std::vector<frame_ptr> capture_frames(std::size_t skip, std::size_t max_depth);
#endif
CPPTRACE_FORCE_NO_INLINE
std::size_t safe_capture_frames(frame_ptr* buffer, std::size_t size, std::size_t skip, std::size_t max_depth);
bool has_safe_unwind();
}
CPPTRACE_END_NAMESPACE
#endif