[2020-02][debugger] Bump protocol for multi threaded single step implementation ...
[mono-project.git] / mono / utils / mono-error.h
blob69bfb8a47346f4a9995f8630c00e6f0aaac09b22
1 /**
2 * \file
3 */
5 #ifndef __MONO_ERROR_H__
6 #define __MONO_ERROR_H__
8 #include <mono/utils/mono-publib.h>
10 enum {
12 The supplied strings were dup'd by means of calling mono_error_dup_strings.
14 MONO_ERROR_FREE_STRINGS = 0x0001,
17 Something happened while processing the error and the resulting message is incomplete.
19 MONO_ERROR_INCOMPLETE = 0x0002,
21 This MonoError is heap allocated in a mempool
23 MONO_ERROR_MEMPOOL_BOXED = 0x0004
26 enum {
27 MONO_ERROR_NONE = 0,
28 MONO_ERROR_MISSING_METHOD = 1,
29 MONO_ERROR_MISSING_FIELD = 2,
30 MONO_ERROR_TYPE_LOAD = 3,
31 MONO_ERROR_FILE_NOT_FOUND = 4,
32 MONO_ERROR_BAD_IMAGE = 5,
33 MONO_ERROR_OUT_OF_MEMORY = 6,
34 MONO_ERROR_ARGUMENT = 7,
35 MONO_ERROR_ARGUMENT_NULL = 11,
36 MONO_ERROR_ARGUMENT_OUT_OF_RANGE = 14,
37 MONO_ERROR_NOT_VERIFIABLE = 8,
38 MONO_ERROR_INVALID_PROGRAM = 12,
39 MONO_ERROR_MEMBER_ACCESS = 13,
42 * This is a generic error mechanism is you need to raise an arbitrary corlib exception.
43 * You must pass the exception name otherwise prepare_exception will fail with internal execution.
45 MONO_ERROR_GENERIC = 9,
46 /* This one encapsulates a managed exception instance */
47 MONO_ERROR_EXCEPTION_INSTANCE = 10,
49 /* Not a valid error code - indicates that the error was cleaned up and reused */
50 MONO_ERROR_CLEANUP_CALLED_SENTINEL = 0xffff
53 #ifdef _MSC_VER
54 __pragma(warning (push))
55 __pragma(warning (disable:4201))
56 #endif
58 /*Keep in sync with MonoErrorInternal*/
59 typedef union _MonoError {
60 // Merge two uint16 into one uint32 so it can be initialized
61 // with one instruction instead of two.
62 uint32_t init;
63 struct {
64 uint16_t error_code;
65 uint16_t private_flags; /*DON'T TOUCH */
66 void *hidden_1 [12]; /*DON'T TOUCH */
68 } MonoErrorExternal;
70 #ifdef _MSC_VER
71 __pragma(warning (pop))
72 #endif
74 #ifdef MONO_INSIDE_RUNTIME
75 typedef union _MonoErrorInternal MonoError;
76 #else
77 typedef MonoErrorExternal MonoError;
78 #endif
80 /* Mempool-allocated MonoError.*/
81 typedef struct _MonoErrorBoxed MonoErrorBoxed;
83 MONO_BEGIN_DECLS
85 MONO_API MONO_RT_EXTERNAL_ONLY void
86 mono_error_init (MonoError *error);
88 MONO_API void
89 mono_error_init_flags (MonoError *error, unsigned short flags);
91 MONO_API void
92 mono_error_cleanup (MonoError *error);
94 MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
95 mono_error_ok (MonoError *error);
97 MONO_API unsigned short
98 mono_error_get_error_code (MonoError *error);
100 MONO_API const char*
101 mono_error_get_message (MonoError *error);
103 MONO_END_DECLS
105 #endif