1 #ifndef __MONO_DEBUG_H__
2 #define __MONO_DEBUG_H__
5 #include <mono/metadata/image.h>
6 #include <mono/metadata/appdomain.h>
8 typedef struct _MonoSymbolFile MonoSymbolFile;
9 typedef struct _MonoSymbolFilePriv MonoSymbolFilePriv;
11 typedef struct _MonoDebugHandle MonoDebugHandle;
12 typedef struct _MonoDebugHandlePriv MonoDebugHandlePriv;
13 typedef struct _MonoDebugDomainData MonoDebugDomainData;
14 typedef struct _MonoDebugDomainDataPriv MonoDebugDomainDataPriv;
16 typedef struct _MonoDebugVarInfo MonoDebugVarInfo;
17 typedef struct _MonoDebugMethodJitInfo MonoDebugMethodJitInfo;
20 MONO_DEBUG_FORMAT_NONE,
21 MONO_DEBUG_FORMAT_MONO,
22 MONO_DEBUG_FORMAT_DEBUGGER
25 struct _MonoDebugHandle {
26 const char *image_file;
28 MonoSymbolFile *symfile;
29 MonoDebugHandlePriv *_priv;
32 struct _MonoDebugMethodJitInfo {
33 const guint8 *code_start;
36 guint32 epilogue_begin;
37 const guint8 *wrapper_addr;
38 // Array of MonoDebugLineNumberEntry
41 MonoDebugVarInfo *this_var;
42 MonoDebugVarInfo *params;
44 MonoDebugVarInfo *locals;
47 struct _MonoDebugDomainData {
49 MonoDebugMethodJitInfo **jit;
50 MonoDebugDomainDataPriv *_priv;
54 * These bits of the MonoDebugLocalInfo's "index" field are flags specifying
55 * where the variable is actually stored.
57 * See relocate_variable() in debug-symfile.c for more info.
59 #define MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS 0xf0000000
61 /* If "index" is zero, the variable is at stack offset "offset". */
62 #define MONO_DEBUG_VAR_ADDRESS_MODE_STACK 0
64 /* The variable is in the register whose number is contained in bits 0..4 of the
65 * "index" field plus an offset of "offset" (which can be zero).
67 #define MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER 0x10000000
69 /* The variables in in the two registers whose numbers are contained in bits 0..4
70 * and 5..9 of the "index" field plus an offset of "offset" (which can be zero).
72 #define MONO_DEBUG_VAR_ADDRESS_MODE_TWO_REGISTERS 0x20000000
74 struct _MonoDebugVarInfo {
82 #define MONO_DEBUGGER_VERSION 28
83 #define MONO_DEBUGGER_MAGIC 0x7aff65af4253d427
85 extern MonoDebugFormat mono_debug_format;
86 extern GHashTable *mono_debug_handles;
88 void mono_debug_init (MonoDebugFormat format);
89 void mono_debug_init_2 (MonoAssembly *assembly);
90 void mono_debug_cleanup (void);
91 MonoDebugDomainData *mono_debug_get_domain_data (MonoDebugHandle *handle, MonoDomain *domain);
92 void mono_debug_add_wrapper (MonoMethod *method, MonoMethod *wrapper_method, MonoDomain *domain);
93 void mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain);
94 gchar *mono_debug_source_location_from_address (MonoMethod *method, guint32 address,
95 guint32 *line_number, MonoDomain *domain);
96 gchar *mono_debug_source_location_from_il_offset (MonoMethod *method, guint32 offset,
97 guint32 *line_number);
98 gint32 mono_debug_il_offset_from_address (MonoMethod *method, gint32 address, MonoDomain *domain);
99 gint32 mono_debug_address_from_il_offset (MonoMethod *method, gint32 il_offset, MonoDomain *domain);
101 #endif /* __MONO_DEBUG_H__ */