2010-04-19 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / metadata / debug-mono-symfile.h
blob9bf2a4f7dbc384311042e9d131e33368113e7b3e
1 /*
2 * This header is only installed for use by the debugger:
3 * the structures and the API declared here are not supported.
4 */
6 #ifndef __MONO_DEBUG_MONO_SYMFILE_H__
7 #define __MONO_DEBUG_MONO_SYMFILE_H__
9 #include <glib.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 guint32 _total_file_size;
24 guint32 _data_section_offset;
25 guint32 _data_section_size;
26 guint32 _compile_unit_count;
27 guint32 _compile_unit_table_offset;
28 guint32 _compile_unit_table_size;
29 guint32 _source_count;
30 guint32 _source_table_offset;
31 guint32 _source_table_size;
32 guint32 _method_count;
33 guint32 _method_table_offset;
34 guint32 _method_table_size;
35 guint32 _type_count;
36 guint32 _anonymous_scope_count;
37 guint32 _anonymous_scope_table_offset;
38 guint32 _anonymous_scope_table_size;
39 guint32 _line_number_table_line_base;
40 guint32 _line_number_table_line_range;
41 guint32 _line_number_table_opcode_base;
42 guint32 _is_aspx_source;
45 struct MonoSymbolFileSourceEntry {
46 guint32 _index;
47 guint32 _data_offset;
50 struct MonoSymbolFileMethodEntry {
51 guint32 _token;
52 guint32 _data_offset;
53 guint32 _line_number_table;
56 struct MonoSymbolFileMethodAddress {
57 guint32 size;
58 const guint8 *start_address;
59 const guint8 *end_address;
60 const guint8 *method_start_address;
61 const guint8 *method_end_address;
62 const guint8 *wrapper_address;
63 guint32 has_this;
64 guint32 num_params;
65 guint32 variable_table_offset;
66 guint32 type_table_offset;
67 guint32 num_line_numbers;
68 guint32 line_number_offset;
69 guint8 data [MONO_ZERO_LEN_ARRAY];
72 struct _MonoDebugMethodInfo {
73 MonoMethod *method;
74 MonoDebugHandle *handle;
75 guint32 index;
76 guint32 data_offset;
77 guint32 lnt_offset;
80 struct _MonoDebugLineNumberEntry {
81 guint32 il_offset;
82 guint32 native_offset;
85 struct _MonoSymbolFile {
86 const guint8 *raw_contents;
87 int raw_contents_size;
88 void *raw_contents_handle;
89 int major_version;
90 int minor_version;
91 gchar *filename;
92 GHashTable *method_hash;
93 MonoSymbolFileOffsetTable *offset_table;
96 #define MONO_SYMBOL_FILE_MAJOR_VERSION 50
97 #define MONO_SYMBOL_FILE_MINOR_VERSION 0
98 #define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614ULL
100 G_BEGIN_DECLS
102 MonoSymbolFile *
103 mono_debug_open_mono_symbols (MonoDebugHandle *handle,
104 const guint8 *raw_contents,
105 int size,
106 gboolean in_the_debugger);
108 void
109 mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile);
111 MonoDebugSourceLocation *
112 mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo,
113 guint32 offset);
115 gint32
116 _mono_debug_address_from_il_offset (MonoDebugMethodJitInfo *jit,
117 guint32 il_offset);
119 MonoDebugMethodInfo *
120 mono_debug_symfile_lookup_method (MonoDebugHandle *handle,
121 MonoMethod *method);
124 mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo, char ***names,
125 int **indexes);
127 void
128 mono_debug_symfile_get_line_numbers (MonoDebugMethodInfo *minfo, char **source_file, int *n_il_offsets, int **il_offsets, int **line_numbers);
130 G_END_DECLS
132 #endif /* __MONO_SYMFILE_H__ */