98174b4b438617c071b70804b310f29b0b2220eb
[mono.git] / mono / metadata / debug-internals.h
1 #ifndef __DEBUG_INTERNALS_H__
2 #define __DEBUG_INTERNALS_H__
3
4 #include <glib.h>
5 #include <mono/metadata/debug-helpers.h>
6 #include <mono/metadata/mono-debug.h>
7 #include <mono/utils/mono-compiler.h>
8
9 struct _MonoDebugMethodInfo {
10         MonoMethod *method;
11         MonoDebugHandle *handle;
12         uint32_t index;
13         uint32_t data_offset;
14         uint32_t lnt_offset;
15 };
16
17 typedef struct {
18         int parent;
19         int type;
20         /* IL offsets */
21         int start_offset, end_offset;
22 } MonoDebugCodeBlock;
23
24 typedef struct {
25         char *name;
26         int index;
27         /* Might be null for the main scope */
28         MonoDebugCodeBlock *block;
29 } MonoDebugLocalVar;
30
31 typedef struct {
32         int start_offset, end_offset;
33 } MonoHoistedLocalScope;
34
35 /*
36  * Information about local variables retrieved from a symbol file.
37  */
38 struct _MonoDebugLocalsInfo {
39         int num_locals;
40         MonoDebugLocalVar *locals;
41         int num_blocks;
42         MonoDebugCodeBlock *code_blocks;
43         int num_hoisted;
44         MonoHoistedLocalScope *hoisted;
45 };
46
47 /*
48 * Information about method await yield and resume offsets retrieved from a symbol file.
49 */
50 struct _MonoDebugMethodAsyncInfo {
51         uint32_t catch_handler_offset;
52         int num_awaits;
53         uint32_t *yield_offsets;
54         uint32_t *resume_offsets;
55         uint32_t *move_next_method_token;
56 };
57
58 struct _MonoDebugLineNumberEntry {
59         uint32_t il_offset;
60         uint32_t native_offset;
61 };
62
63 /*
64  * Information about a source file retrieved from a symbol file.
65  */
66 typedef struct {
67         char *source_file;
68         /* 16 byte long */
69         guint8 *guid, *hash;
70 } MonoDebugSourceInfo;
71
72 typedef struct {
73         int il_offset;
74         int line, column;
75         int end_line, end_column;
76 } MonoSymSeqPoint;
77
78 void            mono_debugger_lock                          (void);
79 void            mono_debugger_unlock                        (void);
80
81 void
82 mono_debug_get_seq_points (MonoDebugMethodInfo *minfo, char **source_file, GPtrArray **source_file_list, int **source_files, MonoSymSeqPoint **seq_points, int *n_seq_points);
83
84 MONO_API void
85 mono_debug_free_locals (MonoDebugLocalsInfo *info);
86
87 void
88 mono_debug_free_method_async_debug_info (MonoDebugMethodAsyncInfo *info);
89
90 gboolean
91 mono_debug_image_has_debug_info (MonoImage *image);
92
93 MonoDebugSourceLocation *
94 mono_debug_lookup_source_location_by_il (MonoMethod *method, guint32 il_offset, MonoDomain *domain);
95
96 #endif /* __DEBUG_INTERNALS_H__ */