1 #ifndef __MONO_DEBUG_SYMFILE_H__
2 #define __MONO_DEBUG_SYMFILE_H__
5 #include <mono/metadata/class.h>
6 #include <mono/metadata/reflection.h>
8 typedef struct MonoDebugSymbolFile MonoDebugSymbolFile;
9 typedef struct MonoDebugSymbolFileSection MonoDebugSymbolFileSection;
10 typedef struct MonoDebugMethodInfo MonoDebugMethodInfo;
11 typedef struct MonoDebugVarInfo MonoDebugVarInfo;
12 typedef struct MonoDebugILOffsetInfo MonoDebugILOffsetInfo;
14 /* Machine dependent information about a method.
16 * This structure is created by the MonoDebugMethodInfoFunc callback of
17 * mono_debug_update_symbol_file (). */
18 struct MonoDebugMethodInfo {
23 MonoDebugVarInfo *this_var;
24 MonoDebugVarInfo *params;
26 MonoDebugVarInfo *locals;
27 guint32 num_il_offsets;
28 MonoDebugILOffsetInfo *il_offsets;
30 guint32 epilogue_begin;
35 * These bits of the MonoDebugLocalInfo's "index" field are flags specifying
36 * where the variable is actually stored.
38 * See relocate_variable() in debug-symfile.c for more info.
40 #define MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS 0xf0000000
42 /* If "index" is zero, the variable is at stack offset "offset". */
43 #define MONO_DEBUG_VAR_ADDRESS_MODE_STACK 0
45 /* The variable is in the register whose number is contained in bits 0..4 of the
46 * "index" field plus an offset of "offset" (which can be zero).
48 #define MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER 0x10000000
50 /* The variables in in the two registers whose numbers are contained in bits 0..4
51 * and 5..9 of the "index" field plus an offset of "offset" (which can be zero).
53 #define MONO_DEBUG_VAR_ADDRESS_MODE_TWO_REGISTERS 0x20000000
55 struct MonoDebugVarInfo {
62 struct MonoDebugILOffsetInfo {
67 struct MonoDebugSymbolFile {
71 /* Pointer to the mmap()ed contents of the file. */
73 size_t raw_contents_size;
74 /* Array of MONO_DEBUG_SYMBOL_SECTION_MAX elements. */
75 MonoDebugSymbolFileSection *section_offsets;
79 struct MonoDebugSymbolFileSection {
85 #define MONO_DEBUG_SYMBOL_FILE_VERSION 10
87 /* Keep in sync with Mono.CSharp.Debugger.MonoDwarfFileWriter.Section */
88 #define MONO_DEBUG_SYMBOL_SECTION_DEBUG_INFO 0x01
89 #define MONO_DEBUG_SYMBOL_SECTION_DEBUG_ABBREV 0x02
90 #define MONO_DEBUG_SYMBOL_SECTION_DEBUG_LINE 0x03
91 #define MONO_DEBUG_SYMBOL_SECTION_MONO_RELOC_TABLE 0x04
93 #define MONO_DEBUG_SYMBOL_SECTION_MAX 0x05
95 /* Tries to load `filename' as a debugging information file, if `emit_warnings" is set,
96 * use g_warning() to signal error messages on failure, otherwise silently return NULL. */
97 MonoDebugSymbolFile *mono_debug_open_symbol_file (MonoImage *image,
99 gboolean emit_warnings);
101 /* This callback function needs to return a MonoDebugMethodInfo structure containing the
102 * machine-dependent information about method associated with the metadata_token.
103 * It's highly recommended to cache the generated data since this function can be called
104 * several times per method. */
105 typedef MonoDebugMethodInfo * (*MonoDebugMethodInfoFunc) (MonoDebugSymbolFile *symbol_file,
106 guint32 metadata_token,
109 void mono_debug_update_symbol_file (MonoDebugSymbolFile *symbol_file,
110 MonoDebugMethodInfoFunc method_info_func,
113 void mono_debug_close_symbol_file (MonoDebugSymbolFile *symbol_file);
116 ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig (MonoReflectionAssembly *assembly,
117 MonoArray *signature);
119 MonoReflectionMethod *
120 ves_icall_Debugger_MonoSymbolWriter_method_from_token (MonoReflectionAssembly *assembly,
124 ves_icall_Debugger_DwarfFileWriter_get_type_token (MonoReflectionType *type);
127 #endif /* __MONO_DEBUG_SYMFILE_H__ */