il2cpp-mono-api.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #pragma once
  2. // This header defines the Mono embedding API that the debugger code requires.
  3. // It should not include any Mono headers.
  4. #include <stdint.h>
  5. #include "il2cpp-config-api.h"
  6. #include "il2cpp-class-internals.h"
  7. #include "vm-utils/Debugger.h"
  8. #include "vm/GlobalMetadataFileInternals.h"
  9. typedef struct _MonoAppDomain MonoAppDomain;
  10. typedef struct _MonoArray MonoArray;
  11. typedef struct _MonoAssembly MonoAssembly;
  12. typedef struct _MonoAssemblyLoadContext MonoAssemblyLoadContext;
  13. typedef struct _MonoClass MonoClass;
  14. typedef struct _MonoClassField MonoClassField;
  15. typedef struct _MonoDebugLocalsInfo MonoDebugLocalsInfo;
  16. typedef struct _MonoDebugMethodJitInfo MonoDebugMethodJitInfo;
  17. typedef struct _MonoDomain MonoDomain;
  18. typedef union _MonoError MonoError;
  19. typedef struct _MonoException MonoException;
  20. typedef struct _MonoGenericClass MonoGenericClass;
  21. typedef struct _MonoGenericContainer MonoGenericContainer;
  22. typedef struct _MonoGenericContext MonoGenericContext;
  23. typedef struct _MonoGenericInst MonoGenericInst;
  24. typedef struct _MonoGenericParam MonoGenericParam;
  25. typedef struct _MonoImage MonoImage;
  26. typedef struct _MonoInternalThread MonoInternalThread;
  27. typedef struct _MonoMethod MonoMethod;
  28. typedef struct _MonoMethodInflated MonoMethodInflated;
  29. typedef struct _MonoMethodHeader MonoMethodHeader;
  30. typedef struct _MonoMethodSignature MonoMethodSignature;
  31. typedef struct _MonoObject MonoObject;
  32. typedef struct _MonoProperty MonoProperty;
  33. typedef struct _MonoReflectionType MonoReflectionType;
  34. typedef struct _MonoString MonoString;
  35. typedef struct _MonoThread MonoThread;
  36. typedef struct _MonoType MonoType;
  37. typedef struct MonoVTable MonoVTable;
  38. typedef struct MonoTypeNameParse MonoTypeNameParse;
  39. typedef struct _GPtrArray GPtrArray;
  40. typedef void* MonoGCDescriptor;
  41. typedef void (*MonoDomainFunc) (MonoDomain *domain, void* user_data);
  42. typedef int32_t (*Il2CppMonoInternalStackWalk) (void /*MonoStackFrameInfo*/ *frame, void /*MonoContext*/ *ctx, void* data);
  43. typedef void* (*MonoGCLockedCallbackFunc) (void *data);
  44. typedef struct
  45. {
  46. void* (*create_method_pointer)(MethodInfo * method, void /*MonoError*/ *error);
  47. Il2CppObject* (*runtime_invoke)(MethodInfo * method, void *obj, void **params, Il2CppObject **exc, void /*MonoError*/ *error);
  48. void (*init_delegate)(Il2CppDelegate *del);
  49. #ifndef DISABLE_REMOTING
  50. void* (*get_remoting_invoke)(void* imethod, void /*MonoError*/ *error);
  51. #endif
  52. void* (*create_trampoline)(Il2CppDomain * domain, MethodInfo *method, void /*MonoError*/ *error);
  53. void (*walk_stack_with_ctx)(Il2CppMonoInternalStackWalk func, void /*MonoContext*/ *ctx, int32_t /*MonoUnwindOptions*/ options, void *user_data);
  54. void (*set_resume_state)(void /*MonoJitTlsData*/ *jit_tls, Il2CppException *ex, void /*MonoJitExceptionInfo*/ *ei, void /*Il2CppSequencePointExecutionContext*/* interp_frame, void* handler_ip);
  55. int32_t (*run_finally)(void /*MonoStackFrameInfo*/ *frame, int clause_index, void* handler_ip);
  56. int32_t (*run_filter)(void /*MonoStackFrameInfo*/ *frame, Il2CppException *ex, int clause_index, void* handler_ip);
  57. void (*frame_iter_init)(void /*MonoInterpStackIter*/ *iter, void* interp_exit_data);
  58. int32_t (*frame_iter_next)(void /*MonoInterpStackIter*/ *iter, void /*MonoStackFrameInfo*/ *frame);
  59. void /*MonoJitInfo*/* (*find_jit_info)(Il2CppDomain * domain, MethodInfo *method);
  60. void (*set_breakpoint)(void /*MonoJitInfo*/ *jinfo, void* ip);
  61. void (*clear_breakpoint)(void /*MonoJitInfo*/ *jinfo, void* ip);
  62. void /*MonoJitInfo*/* (*frame_get_jit_info)(void /*Il2CppSequencePointExecutionContext*/* frame);
  63. void* (*frame_get_ip)(void /*Il2CppSequencePointExecutionContext*/* frame);
  64. void* (*frame_get_arg)(void /*Il2CppSequencePointExecutionContext*/* frame, int pos);
  65. void* (*frame_get_local)(void /*Il2CppSequencePointExecutionContext*/* frame, int pos);
  66. void* (*frame_get_this)(void /*Il2CppSequencePointExecutionContext*/* frame);
  67. void /*Il2CppSequencePointExecutionContext*/* (*frame_get_parent)(void /*Il2CppSequencePointExecutionContext*/* frame);
  68. void (*start_single_stepping)();
  69. void (*stop_single_stepping)();
  70. } MonoInterpCallbacks;
  71. #if defined(__cplusplus)
  72. enum class MonoTypeNameFormat;
  73. #else
  74. enum MonoTypeNameFormat;
  75. #endif // __cplusplus
  76. #if defined(__cplusplus)
  77. extern "C"
  78. {
  79. #endif // __cplusplus
  80. // PS4 and PS4 define IL2CPP_EXPORT in their toolchains and
  81. // pass the value to the compiler. So we cannot easily override it.
  82. // The value conflicts with the Mono headers. Since we don't actually
  83. // need to export these symbols, just define this as empty on PS platforms.
  84. #if IL2CPP_TARGET_PS4 || IL2CPP_TARGET_PS5
  85. #define IL2CPP_MONO_EXPORT
  86. #else
  87. #define IL2CPP_MONO_EXPORT IL2CPP_EXPORT
  88. #endif
  89. #define DO_MONO_API(r, n, p) IL2CPP_MONO_EXPORT r n p;
  90. #define DO_MONO_API_NO_RETURN(r, n, p) IL2CPP_MONO_EXPORT NORETURN r n p;
  91. #define DO_MONO_API_NOT_EXPORTED(r, n, p) r n p;
  92. #include "il2cpp-mono-api-functions.h"
  93. #undef DO_MONO_API
  94. #undef DO_API_NORETURN
  95. #if defined(__cplusplus)
  96. }
  97. #endif // __cplusplus