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 uint32_t _total_file_size;
24 uint32_t _data_section_offset;
25 uint32_t _data_section_size;
26 uint32_t _compile_unit_count;
27 uint32_t _compile_unit_table_offset;
28 uint32_t _compile_unit_table_size;
29 uint32_t _source_count;
30 uint32_t _source_table_offset;
31 uint32_t _source_table_size;
32 uint32_t _method_count;
33 uint32_t _method_table_offset;
34 uint32_t _method_table_size;
36 uint32_t _anonymous_scope_count;
37 uint32_t _anonymous_scope_table_offset;
38 uint32_t _anonymous_scope_table_size;
39 uint32_t _line_number_table_line_base;
40 uint32_t _line_number_table_line_range;
41 uint32_t _line_number_table_opcode_base;
42 uint32_t _is_aspx_source;
45 struct MonoSymbolFileSourceEntry {
47 uint32_t _data_offset;
50 struct MonoSymbolFileMethodEntry {
52 uint32_t _data_offset;
53 uint32_t _line_number_table;
56 struct MonoSymbolFileMethodAddress {
58 const uint8_t *start_address;
59 const uint8_t *end_address;
60 const uint8_t *method_start_address;
61 const uint8_t *method_end_address;
62 const uint8_t *wrapper_address;
65 uint32_t variable_table_offset;
66 uint32_t type_table_offset;
67 uint32_t num_line_numbers;
68 uint32_t line_number_offset;
69 uint8_t 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 uint32_t native_offset;
110 * Information about a source file retrieved from a symbol file.
116 } MonoDebugSourceInfo;
118 #define MONO_SYMBOL_FILE_MAJOR_VERSION 50
119 #define MONO_SYMBOL_FILE_MINOR_VERSION 0
120 #define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614ULL
125 mono_debug_open_mono_symbols (MonoDebugHandle *handle,
126 const uint8_t *raw_contents,
128 mono_bool in_the_debugger);
131 mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile);
134 mono_debug_symfile_is_loaded (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);
161 mono_debug_symfile_get_line_numbers_full (MonoDebugMethodInfo *minfo, char **source_file, GPtrArray **source_file_list, int *n_il_offsets, int **il_offsets, int **line_numbers, int **source_files);
165 #endif /* __MONO_SYMFILE_H__ */