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)
5 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
8 #ifndef __MONO_DEBUG_MONO_SYMFILE_H__
9 #define __MONO_DEBUG_MONO_SYMFILE_H__
12 #include <mono/metadata/class.h>
13 #include <mono/metadata/reflection.h>
14 #include <mono/metadata/mono-debug.h>
16 typedef struct MonoSymbolFileOffsetTable MonoSymbolFileOffsetTable;
17 typedef struct MonoSymbolFileLineNumberEntry MonoSymbolFileLineNumberEntry;
18 typedef struct MonoSymbolFileMethodAddress MonoSymbolFileMethodAddress;
19 typedef struct MonoSymbolFileDynamicTable MonoSymbolFileDynamicTable;
20 typedef struct MonoSymbolFileSourceEntry MonoSymbolFileSourceEntry;
21 typedef struct MonoSymbolFileMethodEntry MonoSymbolFileMethodEntry;
23 /* Keep in sync with OffsetTable in mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs */
24 struct MonoSymbolFileOffsetTable {
25 uint32_t _total_file_size;
26 uint32_t _data_section_offset;
27 uint32_t _data_section_size;
28 uint32_t _compile_unit_count;
29 uint32_t _compile_unit_table_offset;
30 uint32_t _compile_unit_table_size;
31 uint32_t _source_count;
32 uint32_t _source_table_offset;
33 uint32_t _source_table_size;
34 uint32_t _method_count;
35 uint32_t _method_table_offset;
36 uint32_t _method_table_size;
38 uint32_t _anonymous_scope_count;
39 uint32_t _anonymous_scope_table_offset;
40 uint32_t _anonymous_scope_table_size;
41 uint32_t _line_number_table_line_base;
42 uint32_t _line_number_table_line_range;
43 uint32_t _line_number_table_opcode_base;
44 uint32_t _is_aspx_source;
47 struct MonoSymbolFileSourceEntry {
49 uint32_t _data_offset;
52 struct MonoSymbolFileMethodEntry {
54 uint32_t _data_offset;
55 uint32_t _line_number_table;
58 struct MonoSymbolFileMethodAddress {
60 const uint8_t *start_address;
61 const uint8_t *end_address;
62 const uint8_t *method_start_address;
63 const uint8_t *method_end_address;
64 const uint8_t *wrapper_address;
67 uint32_t variable_table_offset;
68 uint32_t type_table_offset;
69 uint32_t num_line_numbers;
70 uint32_t line_number_offset;
71 uint8_t data [MONO_ZERO_LEN_ARRAY];
74 struct _MonoDebugMethodInfo {
76 MonoDebugHandle *handle;
86 int start_offset, end_offset;
92 /* Might be null for the main scope */
93 MonoDebugCodeBlock *block;
97 * Information about local variables retrieved from a symbol file.
99 struct _MonoDebugLocalsInfo {
101 MonoDebugLocalVar *locals;
103 MonoDebugCodeBlock *code_blocks;
106 struct _MonoDebugLineNumberEntry {
108 uint32_t native_offset;
112 * Information about a source file retrieved from a symbol file.
118 } MonoDebugSourceInfo;
123 int end_line, end_column;
126 #define MONO_SYMBOL_FILE_MAJOR_VERSION 50
127 #define MONO_SYMBOL_FILE_MINOR_VERSION 0
128 #define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614ULL
132 MONO_API MonoSymbolFile *
133 mono_debug_open_mono_symbols (MonoDebugHandle *handle,
134 const uint8_t *raw_contents,
136 mono_bool in_the_debugger);
139 mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile);
142 mono_debug_symfile_is_loaded (MonoSymbolFile *symfile);
144 MONO_API MonoDebugSourceLocation *
145 mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo,
149 mono_debug_symfile_free_location (MonoDebugSourceLocation *location);
151 MONO_API MonoDebugMethodInfo *
152 mono_debug_symfile_lookup_method (MonoDebugHandle *handle,
155 MONO_API MonoDebugLocalsInfo*
156 mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo);
159 mono_debug_symfile_get_seq_points (MonoDebugMethodInfo *minfo, char **source_file, GPtrArray **source_file_list, int **source_files, MonoSymSeqPoint **seq_points, int *n_seq_points);
162 mono_debug_image_has_debug_info (MonoImage *image);
166 #endif /* __MONO_SYMFILE_H__ */