StackTrace.h
1.69 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include <stdint.h>
#include <vector>
#include "il2cpp-config.h"
#include "il2cpp-metadata.h"
#if IL2CPP_TINY_DEBUGGER
#include <string>
#endif
#if IL2CPP_ENABLE_NATIVE_STACKTRACES
struct MethodDefinitionKey
{
Il2CppMethodPointer method;
MethodIndex methodIndex;
};
#endif
namespace il2cpp
{
namespace vm
{
typedef std::vector<Il2CppStackFrameInfo> StackFrames;
class LIBIL2CPP_CODEGEN_API StackTrace
{
public:
static void InitializeStackTracesForCurrentThread();
static void CleanupStackTracesForCurrentThread();
#if IL2CPP_TINY_DEBUGGER
static std::string GetStackTrace();
#endif
// Current thread functions
static const StackFrames* GetStackFrames();
static const StackFrames* GetCachedStackFrames(int32_t depth);
static bool GetStackFrameAt(int32_t depth, Il2CppStackFrameInfo& frame);
static void WalkFrameStack(Il2CppFrameWalkFunc callback, void* context);
inline static size_t GetStackDepth() { return GetStackFrames()->size(); }
inline static bool GetTopStackFrame(Il2CppStackFrameInfo& frame) { return GetStackFrameAt(0, frame); }
static void PushFrame(Il2CppStackFrameInfo& frame);
static void PopFrame();
static const void* GetStackPointer();
// Remote thread functions
static bool GetThreadStackFrameAt(Il2CppThread* thread, int32_t depth, Il2CppStackFrameInfo& frame);
static void WalkThreadFrameStack(Il2CppThread* thread, Il2CppFrameWalkFunc callback, void* context);
static int32_t GetThreadStackDepth(Il2CppThread* thread);
static bool GetThreadTopStackFrame(Il2CppThread* thread, Il2CppStackFrameInfo& frame);
};
}
}