2 * Copyright 2015 Xamarin Inc
3 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
6 #ifndef __MONO_SEQ_POINTS_DATA_H__
7 #define __MONO_SEQ_POINTS_DATA_H__
11 #define MONO_SEQ_POINT_FLAG_NONEMPTY_STACK 1
12 #define MONO_SEQ_POINT_FLAG_EXIT_IL 2
14 /* IL offsets used to mark the sequence points belonging to method entry/exit events */
15 #define METHOD_ENTRY_IL_OFFSET -1
16 #define METHOD_EXIT_IL_OFFSET 0xffffff
18 #define SEQ_POINT_AOT_EXT ".msym"
20 /* Native offset used to mark seq points in dead code */
21 #define SEQ_POINT_NATIVE_OFFSET_DEAD_CODE -1
24 int il_offset, native_offset, flags;
25 /* Offset of indexes of successor sequence points on the compressed buffer */
27 /* Number of entries in next */
31 typedef struct MonoSeqPointInfo {
40 gboolean has_debug_data;
44 mono_seq_point_info_free (gpointer info);
47 mono_seq_point_iterator_next (SeqPointIterator* it);
50 mono_seq_point_iterator_init (SeqPointIterator* it, MonoSeqPointInfo* info);
53 mono_seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPoint* next);
56 mono_seq_point_info_write (MonoSeqPointInfo* info, guint8* buffer);
59 mono_seq_point_info_read (MonoSeqPointInfo** info, guint8* buffer, gboolean copy);
62 mono_seq_point_info_get_write_size (MonoSeqPointInfo* info);
65 mono_seq_point_info_add_seq_point (GByteArray* array, SeqPoint *sp, SeqPoint *last_seq_point, GSList *next, gboolean has_debug_data);
68 mono_seq_point_info_new (int len, gboolean alloc_data, guint8 *data, gboolean has_debug_data, int *out_size);
71 mono_seq_point_find_prev_by_native_offset (MonoSeqPointInfo* info, int native_offset, SeqPoint* seq_point);
74 mono_seq_point_find_next_by_native_offset (MonoSeqPointInfo* info, int native_offset, SeqPoint* seq_point);
77 mono_seq_point_find_by_il_offset (MonoSeqPointInfo* info, int il_offset, SeqPoint* seq_point);
80 * SeqPointData struct and functions
81 * 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 mono_seq_point_data_init (SeqPointData *data, int entry_capacity);
101 mono_seq_point_data_free (SeqPointData *data);
104 mono_seq_point_data_read (SeqPointData *data, char *path);
107 mono_seq_point_data_write (SeqPointData *data, char *path);
110 mono_seq_point_data_add (SeqPointData *data, guint32 methodToken, guint32 methodIndex, MonoSeqPointInfo* info);
113 mono_seq_point_data_get (SeqPointData *data, guint32 methodToken, guint32 methodIndex, MonoSeqPointInfo** info);
116 mono_seq_point_data_get_il_offset (char *path, guint32 methodToken, guint32 methodIndex, guint32 native_offset, guint32 *il_offset);
118 #endif /* __MONO_SEQ_POINTS_DATA_H__ */