MonoSeqPointInfo data is now compressed. Encode data MonoSeqPointInfo len, has_debug_...
[mono.git] / mono / mini / seq-points.h
1 /*
2  * Copyright 2014 Xamarin Inc
3  */
4  
5 #ifndef __MONO_SEQ_POINTS_H__
6 #define __MONO_SEQ_POINTS_H__
7
8 #define MONO_SEQ_POINT_FLAG_NONEMPTY_STACK 1
9
10 /* IL offsets used to mark the sequence points belonging to method entry/exit events */
11 #define METHOD_ENTRY_IL_OFFSET -1
12 #define METHOD_EXIT_IL_OFFSET -2
13
14 /* Native offset used to mark seq points in dead code */
15 #define SEQ_POINT_NATIVE_OFFSET_DEAD_CODE -1
16
17 typedef struct {
18         int il_offset, native_offset, flags;
19         /* Offset of indexes of successor sequence points on the compressed buffer */
20         int next_offset;
21         /* Number of entries in next */
22         int next_len;
23 } SeqPoint;
24
25 typedef struct MonoSeqPointInfo {
26 } MonoSeqPointInfo;
27
28 typedef struct {
29         SeqPoint seq_point;
30         guint8* ptr;
31         guint8* begin;
32         guint8* end;
33         gboolean has_debug_data;
34 } SeqPointIterator;
35
36 void
37 seq_point_info_free (gpointer info);
38
39 void
40 mono_save_seq_point_info (MonoCompile *cfg);
41
42 MonoSeqPointInfo*
43 get_seq_points (MonoDomain *domain, MonoMethod *method);
44
45 gboolean
46 find_next_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point);
47
48 gboolean
49 find_prev_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point);
50
51 gboolean
52 find_seq_point (MonoDomain *domain, MonoMethod *method, gint32 il_offset, MonoSeqPointInfo **info, SeqPoint *seq_point);
53
54 gboolean
55 seq_point_iterator_next (SeqPointIterator* it);
56
57 void
58 seq_point_iterator_init (SeqPointIterator* it, MonoSeqPointInfo* info);
59
60 void
61 seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPoint* next);
62
63 int
64 seq_point_info_write (MonoSeqPointInfo* info, guint8* buffer);
65
66 int
67 seq_point_info_read (MonoSeqPointInfo** info, guint8* buffer, gboolean copy);
68
69 int
70 seq_point_info_write_size (MonoSeqPointInfo* info);
71
72 #endif /* __MONO_SEQ_POINTS_H__ */