少年修仙传客户端基础资源
hch
2024-04-11 4c71d74b77c9eb62a0323698c9a0db3b641a917e
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
#include <stdint.h>
#include <cstddef>
#include "il2cpp-config.h"
#include "mono-api.h"
#include "il2cpp-mono-support.h"
#include "icalls/mscorlib/System.Diagnostics/StackTrace.h"
 
namespace mono
{
namespace icalls
{
namespace mscorlib
{
namespace System
{
namespace Diagnostics
{
    MonoArray* StackTrace::get_trace(MonoException *exc, int32_t skip, bool need_file_info)
    {
        MonoArray *ta = mono_unity_exception_get_trace_ips(exc);
 
        MonoClass* stackFrameClass = mono_unity_defaults_get_stack_frame_class();
        if (ta == NULL)
        {
            /* Exception is not thrown yet */
            return MonoArrayNew(stackFrameClass, 0);
        }
 
        int len = (int)mono_array_length(ta);
 
        MonoArray* res = MonoArrayNew(stackFrameClass, len > skip ? len - skip : 0);
 
        for (int i = skip; i < len; i++)
        {
            MonoStackFrame* sf = (MonoStackFrame*)mono_object_new(g_MonoDomain, stackFrameClass);
            MonoMethod* method = mono_array_get(ta, MonoMethod*, i);
 
            mono_unity_stackframe_set_method(sf, method);
            mono_array_setref(res, i, sf);
        }
 
        return res;
    }
} /* namespace Diagnostics */
} /* namespace System */
} /* namespace mscorlib */
} /* namespace icalls */
} /* namespace mono */