3 * This header is only installed for use by the debugger:
4 * the structures and the API declared here are not supported.
5 * Copyright 2012 Xamarin Inc (http://www.xamarin.com)
6 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
9 #ifndef __MONO_DEBUG_MONO_SYMFILE_H__
10 #define __MONO_DEBUG_MONO_SYMFILE_H__
13 #include <mono/metadata/class.h>
14 #include <mono/metadata/reflection.h>
15 #include <mono/metadata/mono-debug.h>
16 #include <mono/metadata/debug-internals.h>
18 typedef struct MonoSymbolFileOffsetTable MonoSymbolFileOffsetTable;
19 typedef struct MonoSymbolFileLineNumberEntry MonoSymbolFileLineNumberEntry;
20 typedef struct MonoSymbolFileMethodAddress MonoSymbolFileMethodAddress;
21 typedef struct MonoSymbolFileDynamicTable MonoSymbolFileDynamicTable;
22 typedef struct MonoSymbolFileSourceEntry MonoSymbolFileSourceEntry;
23 typedef struct MonoSymbolFileMethodEntry MonoSymbolFileMethodEntry;
25 /* Keep in sync with OffsetTable in mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs */
26 struct MonoSymbolFileOffsetTable {
27 uint32_t _total_file_size;
28 uint32_t _data_section_offset;
29 uint32_t _data_section_size;
30 uint32_t _compile_unit_count;
31 uint32_t _compile_unit_table_offset;
32 uint32_t _compile_unit_table_size;
33 uint32_t _source_count;
34 uint32_t _source_table_offset;
35 uint32_t _source_table_size;
36 uint32_t _method_count;
37 uint32_t _method_table_offset;
38 uint32_t _method_table_size;
40 uint32_t _anonymous_scope_count;
41 uint32_t _anonymous_scope_table_offset;
42 uint32_t _anonymous_scope_table_size;
43 uint32_t _line_number_table_line_base;
44 uint32_t _line_number_table_line_range;
45 uint32_t _line_number_table_opcode_base;
46 uint32_t _is_aspx_source;
49 struct MonoSymbolFileSourceEntry {
51 uint32_t _data_offset;
54 struct MonoSymbolFileMethodEntry {
56 uint32_t _data_offset;
57 uint32_t _line_number_table;
60 struct MonoSymbolFileMethodAddress {
62 const uint8_t *start_address;
63 const uint8_t *end_address;
64 const uint8_t *method_start_address;
65 const uint8_t *method_end_address;
66 const uint8_t *wrapper_address;
69 uint32_t variable_table_offset;
70 uint32_t type_table_offset;
71 uint32_t num_line_numbers;
72 uint32_t line_number_offset;
73 uint8_t data [MONO_ZERO_LEN_ARRAY];
76 #define MONO_SYMBOL_FILE_MAJOR_VERSION 50
77 #define MONO_SYMBOL_FILE_MINOR_VERSION 0
78 #define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614ULL
82 MONO_API MonoSymbolFile *
83 mono_debug_open_mono_symbols (MonoDebugHandle *handle,
84 const uint8_t *raw_contents,
86 mono_bool in_the_debugger);
89 mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile);
92 mono_debug_symfile_is_loaded (MonoSymbolFile *symfile);
94 MONO_API MonoDebugSourceLocation *
95 mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo,
99 mono_debug_symfile_free_location (MonoDebugSourceLocation *location);
101 MONO_API MonoDebugMethodInfo *
102 mono_debug_symfile_lookup_method (MonoDebugHandle *handle,
105 MONO_API MonoDebugLocalsInfo*
106 mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo);
109 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);
113 #endif /* __MONO_SYMFILE_H__ */