@@ -1149,7 +1149,8 @@ mono_debugger_run_debugger_thread_func(void* arg)
1149
1149
}
1150
1150
1151
1151
typedef struct {
1152
- void (* il2cpp_debugger_save_thread_context )(Il2CppThreadUnwindState * context );
1152
+ void (* il2cpp_debugger_save_thread_context )(Il2CppThreadUnwindState * context , int frameCountAdjust );
1153
+ void (* il2cpp_debugger_free_thread_context )(Il2CppThreadUnwindState * context );
1153
1154
} MonoDebuggerRuntimeCallbacks ;
1154
1155
1155
1156
static MonoDebuggerRuntimeCallbacks callbacks ;
@@ -2679,7 +2680,7 @@ save_thread_context (MonoContext *ctx)
2679
2680
else
2680
2681
mono_thread_state_init_from_current (& tls -> context );
2681
2682
#else
2682
- callbacks .il2cpp_debugger_save_thread_context (& tls -> il2cpp_context );
2683
+ callbacks .il2cpp_debugger_save_thread_context (& tls -> il2cpp_context , 0 );
2683
2684
#endif // !RUNTIME_IL2CPP
2684
2685
}
2685
2686
@@ -4213,6 +4214,8 @@ thread_end (MonoProfiler *prof, uintptr_t tid)
4213
4214
/* Can't remove from tid_to_thread, as that would defeat the check in thread_start () */
4214
4215
#ifndef RUNTIME_IL2CPP
4215
4216
MONO_GC_UNREGISTER_ROOT (tls -> thread );
4217
+ #else
4218
+ callbacks .il2cpp_debugger_free_thread_context (& tls -> il2cpp_context );
4216
4219
#endif
4217
4220
tls -> thread = NULL ;
4218
4221
}
@@ -12321,6 +12324,19 @@ gboolean unity_sequence_point_active(Il2CppSequencePoint *seqPoint)
12321
12324
return FALSE;
12322
12325
}
12323
12326
12327
+ void il2cpp_save_current_thread_context_func_exit ()
12328
+ {
12329
+ DebuggerTlsData * tls ;
12330
+
12331
+ MonoInternalThread * thread = mono_thread_internal_current ();
12332
+
12333
+ mono_loader_lock ();
12334
+ tls = (DebuggerTlsData * )mono_g_hash_table_lookup (thread_to_tls , thread );
12335
+ mono_loader_unlock ();
12336
+
12337
+ callbacks .il2cpp_debugger_save_thread_context (& tls -> il2cpp_context , -1 );
12338
+ }
12339
+
12324
12340
#endif // RUNTIME_IL2CPP
12325
12341
12326
12342
#else /* DISABLE_DEBUGGER_AGENT */
0 commit comments