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>
15 #include <mono/metadata/debug-internals.h>
17 typedef struct MonoSymbolFileOffsetTable MonoSymbolFileOffsetTable;
18 typedef struct MonoSymbolFileLineNumberEntry MonoSymbolFileLineNumberEntry;
19 typedef struct MonoSymbolFileMethodAddress MonoSymbolFileMethodAddress;
20 typedef struct MonoSymbolFileDynamicTable MonoSymbolFileDynamicTable;
21 typedef struct MonoSymbolFileSourceEntry MonoSymbolFileSourceEntry;
22 typedef struct MonoSymbolFileMethodEntry MonoSymbolFileMethodEntry;
24 /* Keep in sync with OffsetTable in mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs */
25 struct MonoSymbolFileOffsetTable {
26 uint32_t _total_file_size;
27 uint32_t _data_section_offset;
28 uint32_t _data_section_size;
29 uint32_t _compile_unit_count;
30 uint32_t _compile_unit_table_offset;
31 uint32_t _compile_unit_table_size;
32 uint32_t _source_count;
33 uint32_t _source_table_offset;
34 uint32_t _source_table_size;
35 uint32_t _method_count;
36 uint32_t _method_table_offset;
37 uint32_t _method_table_size;
39 uint32_t _anonymous_scope_count;
40 uint32_t _anonymous_scope_table_offset;
41 uint32_t _anonymous_scope_table_size;
42 uint32_t _line_number_table_line_base;
43 uint32_t _line_number_table_line_range;
44 uint32_t _line_number_table_opcode_base;
45 uint32_t _is_aspx_source;
48 struct MonoSymbolFileSourceEntry {
50 uint32_t _data_offset;
53 struct MonoSymbolFileMethodEntry {
55 uint32_t _data_offset;
56 uint32_t _line_number_table;
59 struct MonoSymbolFileMethodAddress {
61 const uint8_t *start_address;
62 const uint8_t *end_address;
63 const uint8_t *method_start_address;
64 const uint8_t *method_end_address;
65 const uint8_t *wrapper_address;
68 uint32_t variable_table_offset;
69 uint32_t type_table_offset;
70 uint32_t num_line_numbers;
71 uint32_t line_number_offset;
72 uint8_t data [MONO_ZERO_LEN_ARRAY];
75 #define MONO_SYMBOL_FILE_MAJOR_VERSION 50
76 #define MONO_SYMBOL_FILE_MINOR_VERSION 0
77 #define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614ULL
81 MONO_API MonoSymbolFile *
82 mono_debug_open_mono_symbols (MonoDebugHandle *handle,
83 const uint8_t *raw_contents,
85 mono_bool in_the_debugger);
88 mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile);
91 mono_debug_symfile_is_loaded (MonoSymbolFile *symfile);
93 MONO_API MonoDebugSourceLocation *
94 mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo,
98 mono_debug_symfile_free_location (MonoDebugSourceLocation *location);
100 MONO_API MonoDebugMethodInfo *
101 mono_debug_symfile_lookup_method (MonoDebugHandle *handle,
104 MONO_API MonoDebugLocalsInfo*
105 mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo);
108 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);
112 #endif /* __MONO_SYMFILE_H__ */