-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathil2cpp-debugger.cpp
More file actions
114 lines (88 loc) · 2.46 KB
/
il2cpp-debugger.cpp
File metadata and controls
114 lines (88 loc) · 2.46 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#if IL2CPP_DEBUGGER_ENABLED
#include "il2cpp-debugger.h"
#include "debugger/agent.h"
#include "debugger/command-line-parser.h"
using namespace il2cpp;
bool il2cpp_debugger_parse_command_line(int argc, char* argv[], char** host, int32_t* port, bool* print_help)
{
debugger::CommandLineOptions options;
bool properArgumentsProvided = debugger::CommandLineParser::Parse(argc, argv, &options);
*print_help = options.print_help;
if (properArgumentsProvided)
{
*host = options.host;
*port = options.port;
}
return properArgumentsProvided;
}
void il2cpp_debugger_print_usage()
{
debugger::CommandLineParser::PrintUsage(std::cout);
}
void il2cpp_debugger_agent_init()
{
debugger::Agent::instance().Initialize(
debugger::AgentConfig::Default);
}
void il2cpp_debugger_agent_init(const char *host, int32_t port)
{
debugger::AgentConfig config;
config.server = true;
config.host = host;
config.port = port;
debugger::Agent::instance().Initialize(config);
}
bool il2cpp_debugger_agent_is_initialized()
{
return debugger::Agent::instance().IsInitialized();
}
void il2cpp_debugger_agent_dispose()
{
debugger::Agent::instance().Dispose();
}
void il2cpp_debugger_notify_vm_start()
{
debugger::Agent::instance().NotifyVmStart();
}
void il2cpp_debugger_notify_vm_death()
{
debugger::Agent::instance().NotifyVmDeath();
}
void il2cpp_debugger_notify_user_break()
{
debugger::Agent::instance().NotifyUserBreak();
}
void il2cpp_debugger_notify_appdomain_create(Il2CppDomain *domain)
{
debugger::Agent::instance().NotifyAppDomainCreate(domain);
}
void il2cpp_debugger_notify_assembly_load(const Il2CppAssembly *assembly)
{
debugger::Agent::instance().NotifyAssemblyLoad(assembly);
}
void il2cpp_debugger_sequence_point_hit(int64_t uid, int32_t offset)
{
// TODO: this is time critical, it might make sense to inline it directly?
debugger::Agent::instance().SequencePointHit(uid, offset);
}
void il2cpp_debugger_notify_type_load(TypeInfo *type)
{
debugger::Agent::instance().NotifyTypeLoad(type);
}
void il2cpp_debugger_method_entry(const Il2CppStackFrameInfo &info)
{
debugger::Agent::instance().OnMethodEntry(info);
}
void il2cpp_debugger_method_exit(const Il2CppStackFrameInfo &info)
{
debugger::Agent::instance().OnMethodExit(info);
}
void il2cpp_debugger_notify_thread_attach(Il2CppThread *thread)
{
debugger::Agent::instance().OnThreadAttach(thread);
}
void il2cpp_debugger_notify_thread_detach(Il2CppThread *thread)
{
debugger::Agent::instance().OnThreadDetach(thread);
}
#endif