2 * This header is only installed for use by the debugger:
3 * the structures and the API declared here are not supported.
6 #ifndef __MONO_DEBUG_MONO_SYMFILE_H__
7 #define __MONO_DEBUG_MONO_SYMFILE_H__
10 #include <mono/metadata/class.h>
11 #include <mono/metadata/reflection.h>
12 #include <mono/metadata/mono-debug.h>
14 typedef struct MonoSymbolFileOffsetTable MonoSymbolFileOffsetTable;
15 typedef struct MonoSymbolFileLineNumberEntry MonoSymbolFileLineNumberEntry;
16 typedef struct MonoSymbolFileMethodAddress MonoSymbolFileMethodAddress;
17 typedef struct MonoSymbolFileDynamicTable MonoSymbolFileDynamicTable;
18 typedef struct MonoSymbolFileSourceEntry MonoSymbolFileSourceEntry;
19 typedef struct MonoSymbolFileMethodEntry MonoSymbolFileMethodEntry;
21 /* Keep in sync with OffsetTable in mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs */
22 struct MonoSymbolFileOffsetTable {
23 guint32 _total_file_size;
24 guint32 _data_section_offset;
25 guint32 _data_section_size;
26 guint32 _compile_unit_count;
27 guint32 _compile_unit_table_offset;
28 guint32 _compile_unit_table_size;
29 guint32 _source_count;
30 guint32 _source_table_offset;
31 guint32 _source_table_size;
32 guint32 _method_count;
33 guint32 _method_table_offset;
34 guint32 _method_table_size;
36 guint32 _anonymous_scope_count;
37 guint32 _anonymous_scope_table_offset;
38 guint32 _anonymous_scope_table_size;
39 guint32 _line_number_table_line_base;
40 guint32 _line_number_table_line_range;
41 guint32 _line_number_table_opcode_base;
42 guint32 _is_aspx_source;
45 struct MonoSymbolFileSourceEntry {
50 struct MonoSymbolFileMethodEntry {
53 guint32 _line_number_table;
56 struct MonoSymbolFileMethodAddress {
58 const guint8 *start_address;
59 const guint8 *end_address;
60 const guint8 *method_start_address;
61 const guint8 *method_end_address;
62 const guint8 *wrapper_address;
65 guint32 variable_table_offset;
66 guint32 type_table_offset;
67 guint32 num_line_numbers;
68 guint32 line_number_offset;
69 guint8 data [MONO_ZERO_LEN_ARRAY];
72 struct _MonoDebugMethodInfo {
74 MonoDebugHandle *handle;
84 int start_offset, end_offset;
90 /* Might be null for the main scope */
91 MonoDebugCodeBlock *block;
95 * Information about local variables retrieved from a symbol file.
97 struct _MonoDebugLocalsInfo {
99 MonoDebugLocalVar *locals;
101 MonoDebugCodeBlock *code_blocks;
104 struct _MonoDebugLineNumberEntry {
106 guint32 native_offset;
109 struct _MonoSymbolFile {
110 const guint8 *raw_contents;
111 int raw_contents_size;
112 void *raw_contents_handle;
116 GHashTable *method_hash;
117 MonoSymbolFileOffsetTable *offset_table;
118 gboolean was_loaded_from_memory;
121 #define MONO_SYMBOL_FILE_MAJOR_VERSION 50
122 #define MONO_SYMBOL_FILE_MINOR_VERSION 0
123 #define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614ULL
128 mono_debug_open_mono_symbols (MonoDebugHandle *handle,
129 const guint8 *raw_contents,
131 gboolean in_the_debugger);
134 mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile);
136 MonoDebugSourceLocation *
137 mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo,
141 mono_debug_symfile_free_location (MonoDebugSourceLocation *location);
144 _mono_debug_address_from_il_offset (MonoDebugMethodJitInfo *jit,
147 MonoDebugMethodInfo *
148 mono_debug_symfile_lookup_method (MonoDebugHandle *handle,
152 mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo);
155 mono_debug_symfile_free_locals (MonoDebugLocalsInfo *info);
158 mono_debug_symfile_get_line_numbers (MonoDebugMethodInfo *minfo, char **source_file, int *n_il_offsets, int **il_offsets, int **line_numbers);
162 #endif /* __MONO_SYMFILE_H__ */