2 * This header is only installed for use by the debugger:
3 * the structures and the API declared here are not supported.
4 * Copyright 2012 Xamarin Inc (http://www.xamarin.com)
7 #ifndef __MONO_DEBUG_MONO_SYMFILE_H__
8 #define __MONO_DEBUG_MONO_SYMFILE_H__
11 #include <mono/metadata/class.h>
12 #include <mono/metadata/reflection.h>
13 #include <mono/metadata/mono-debug.h>
15 typedef struct MonoSymbolFileOffsetTable MonoSymbolFileOffsetTable;
16 typedef struct MonoSymbolFileLineNumberEntry MonoSymbolFileLineNumberEntry;
17 typedef struct MonoSymbolFileMethodAddress MonoSymbolFileMethodAddress;
18 typedef struct MonoSymbolFileDynamicTable MonoSymbolFileDynamicTable;
19 typedef struct MonoSymbolFileSourceEntry MonoSymbolFileSourceEntry;
20 typedef struct MonoSymbolFileMethodEntry MonoSymbolFileMethodEntry;
22 /* Keep in sync with OffsetTable in mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs */
23 struct MonoSymbolFileOffsetTable {
24 uint32_t _total_file_size;
25 uint32_t _data_section_offset;
26 uint32_t _data_section_size;
27 uint32_t _compile_unit_count;
28 uint32_t _compile_unit_table_offset;
29 uint32_t _compile_unit_table_size;
30 uint32_t _source_count;
31 uint32_t _source_table_offset;
32 uint32_t _source_table_size;
33 uint32_t _method_count;
34 uint32_t _method_table_offset;
35 uint32_t _method_table_size;
37 uint32_t _anonymous_scope_count;
38 uint32_t _anonymous_scope_table_offset;
39 uint32_t _anonymous_scope_table_size;
40 uint32_t _line_number_table_line_base;
41 uint32_t _line_number_table_line_range;
42 uint32_t _line_number_table_opcode_base;
43 uint32_t _is_aspx_source;
46 struct MonoSymbolFileSourceEntry {
48 uint32_t _data_offset;
51 struct MonoSymbolFileMethodEntry {
53 uint32_t _data_offset;
54 uint32_t _line_number_table;
57 struct MonoSymbolFileMethodAddress {
59 const uint8_t *start_address;
60 const uint8_t *end_address;
61 const uint8_t *method_start_address;
62 const uint8_t *method_end_address;
63 const uint8_t *wrapper_address;
66 uint32_t variable_table_offset;
67 uint32_t type_table_offset;
68 uint32_t num_line_numbers;
69 uint32_t line_number_offset;
70 uint8_t data [MONO_ZERO_LEN_ARRAY];
73 struct _MonoDebugMethodInfo {
75 MonoDebugHandle *handle;
85 int start_offset, end_offset;
91 /* Might be null for the main scope */
92 MonoDebugCodeBlock *block;
96 * Information about local variables retrieved from a symbol file.
98 struct _MonoDebugLocalsInfo {
100 MonoDebugLocalVar *locals;
102 MonoDebugCodeBlock *code_blocks;
105 struct _MonoDebugLineNumberEntry {
107 uint32_t native_offset;
111 * Information about a source file retrieved from a symbol file.
117 } MonoDebugSourceInfo;
119 #define MONO_SYMBOL_FILE_MAJOR_VERSION 50
120 #define MONO_SYMBOL_FILE_MINOR_VERSION 0
121 #define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614ULL
126 mono_debug_open_mono_symbols (MonoDebugHandle *handle,
127 const uint8_t *raw_contents,
129 mono_bool in_the_debugger);
132 mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile);
135 mono_debug_symfile_is_loaded (MonoSymbolFile *symfile);
137 MonoDebugSourceLocation *
138 mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo,
142 mono_debug_symfile_free_location (MonoDebugSourceLocation *location);
145 _mono_debug_address_from_il_offset (MonoDebugMethodJitInfo *jit,
148 MonoDebugMethodInfo *
149 mono_debug_symfile_lookup_method (MonoDebugHandle *handle,
153 mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo);
156 mono_debug_symfile_free_locals (MonoDebugLocalsInfo *info);
159 mono_debug_symfile_get_line_numbers (MonoDebugMethodInfo *minfo, char **source_file, int *n_il_offsets, int **il_offsets, int **line_numbers);
162 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);
166 #endif /* __MONO_SYMFILE_H__ */