2 * Copyright 2014 Xamarin Inc
5 #ifndef __MONO_SEQ_POINTS_H__
6 #define __MONO_SEQ_POINTS_H__
8 #define MONO_SEQ_POINT_FLAG_NONEMPTY_STACK 1
9 #define MONO_SEQ_POINT_FLAG_EXIT_IL 2
11 /* IL offsets used to mark the sequence points belonging to method entry/exit events */
12 #define METHOD_ENTRY_IL_OFFSET -1
13 #define METHOD_EXIT_IL_OFFSET 0xffffff
15 /* Native offset used to mark seq points in dead code */
16 #define SEQ_POINT_NATIVE_OFFSET_DEAD_CODE -1
19 int il_offset, native_offset, flags;
20 /* Offset of indexes of successor sequence points on the compressed buffer */
22 /* Number of entries in next */
26 typedef struct MonoSeqPointInfo {
35 gboolean has_debug_data;
39 seq_point_info_free (gpointer info);
42 mono_save_seq_point_info (MonoCompile *cfg);
45 get_seq_points (MonoDomain *domain, MonoMethod *method);
48 find_next_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point);
51 find_prev_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point);
54 find_seq_point (MonoDomain *domain, MonoMethod *method, gint32 il_offset, MonoSeqPointInfo **info, SeqPoint *seq_point);
57 seq_point_iterator_next (SeqPointIterator* it);
60 seq_point_iterator_init (SeqPointIterator* it, MonoSeqPointInfo* info);
63 seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPoint* next);
66 seq_point_info_write (MonoSeqPointInfo* info, guint8* buffer);
69 seq_point_info_read (MonoSeqPointInfo** info, guint8* buffer, gboolean copy);
72 seq_point_info_get_write_size (MonoSeqPointInfo* info);
75 bb_deduplicate_op_il_seq_points (MonoCompile *cfg, MonoBasicBlock *bb);
78 mono_image_get_aot_seq_point_path (MonoImage *image, char **str);
81 * SeqPointData struct and functions
82 * This is used to store/load/use sequence point from a file
87 MonoSeqPointInfo* seq_points;
88 gboolean free_seq_points;
92 SeqPointDataEntry* entries;
98 seq_point_data_init (SeqPointData *data, int entry_capacity);
101 seq_point_data_free (SeqPointData *data);
104 seq_point_data_read (SeqPointData *data, char *path);
107 seq_point_data_write (SeqPointData *data, char *path);
110 seq_point_data_add (SeqPointData *data, guint32 token, MonoSeqPointInfo* info);
113 seq_point_data_get (SeqPointData *data, guint32 token, MonoSeqPointInfo** info);
115 #endif /* __MONO_SEQ_POINTS_H__ */