少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
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
#include "il2cpp-config.h"
#include "il2cpp-class-internals.h"
#include "il2cpp-object-internals.h"
#include "vm/Array.h"
#include "vm/Object.h"
#include "vm/Reflection.h"
#include "icalls/mscorlib/System.Diagnostics/StackTrace.h"
 
namespace il2cpp
{
namespace icalls
{
namespace mscorlib
{
namespace System
{
namespace Diagnostics
{
    Il2CppArray* StackTrace::get_trace(Il2CppException *exc, int32_t skip, bool need_file_info)
    {
        Il2CppArray *res;
        Il2CppArray *ta = exc->trace_ips;
        int i, len;
 
        if (ta == NULL)
        {
            /* Exception is not thrown yet */
            return vm::Array::New(il2cpp_defaults.stack_frame_class, 0);
        }
 
        len = vm::Array::GetLength(ta);
 
        res = vm::Array::New(il2cpp_defaults.stack_frame_class, len > skip ? len - skip : 0);
 
        for (i = skip; i < len; i++)
        {
            Il2CppStackFrame *sf = (Il2CppStackFrame*)vm::Object::New(il2cpp_defaults.stack_frame_class);
            MethodInfo* method = il2cpp_array_get(ta, MethodInfo*, i);
 
            IL2CPP_OBJECT_SETREF(sf, method, vm::Reflection::GetMethodObject(method, NULL));
 
            il2cpp_array_setref(res, i, sf);
        }
 
        return res;
    }
} /* namespace Diagnostics */
} /* namespace System */
} /* namespace mscorlib */
} /* namespace icalls */
} /* namespace il2cpp */