+ /* Compute the native->IL offset mapping */
+
+ g_assert (code_size);
+
+#ifndef _EGLIB_MAJOR
+ ln_array = g_array_sized_new (FALSE, FALSE, sizeof (MonoDebugLineNumberEntry),
+ debug_info->num_line_numbers);
+ g_array_append_vals (ln_array, debug_info->line_numbers, debug_info->num_line_numbers);
+ g_array_sort (ln_array, (GCompareFunc)compare_lne);
+ native_to_il_offset = g_new0 (int, code_size + 1);
+
+ for (i = 0; i < debug_info->num_line_numbers; ++i) {
+ int j;
+ MonoDebugLineNumberEntry lne = g_array_index (ln_array, MonoDebugLineNumberEntry, i);
+
+ if (i == 0) {
+ for (j = 0; j < lne.native_offset; ++j)
+ native_to_il_offset [j] = -1;
+ }
+
+ if (i < debug_info->num_line_numbers - 1) {
+ MonoDebugLineNumberEntry lne_next = g_array_index (ln_array, MonoDebugLineNumberEntry, i + 1);
+
+ for (j = lne.native_offset; j < lne_next.native_offset; ++j)
+ native_to_il_offset [j] = lne.il_offset;
+ } else {
+ for (j = lne.native_offset; j < code_size; ++j)
+ native_to_il_offset [j] = lne.il_offset;
+ }
+ }
+ g_array_free (ln_array, TRUE);
+#endif