StackTrace.h
971 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
#pragma once
#include "il2cpp-config.h"
#include <string>
#include <vector>
namespace il2cpp
{
namespace os
{
typedef bool(*WalkStackCallback)(Il2CppMethodPointer frame, void* context);
class StackTrace
{
public:
enum WalkOrder
{
kFirstCalledToLastCalled,
kLastCalledToFirstCalled
};
// Walks the stack calling callback for each frame in the stack
// Stops when callback returns false
static void WalkStack(WalkStackCallback callback, void* context, WalkOrder walkOrder);
#if IL2CPP_ENABLE_NATIVE_STACKTRACES
static std::string NativeStackTrace();
#endif
// Returns SP value or nullptr if not implemented
static const void* GetStackPointer();
static void OverrideStackBacktrace(Il2CppBacktraceFunc stackBacktraceFunc);
private:
static void WalkStackNative(WalkStackCallback callback, void* context, WalkOrder walkOrder);
};
}
}