@@ -1160,6 +1160,20 @@ void mono_debugger_install_runtime_callbacks(MonoDebuggerRuntimeCallbacks* cbs)
1160
1160
callbacks = * cbs ;
1161
1161
}
1162
1162
1163
+ uint32_t * g_unity_check ;
1164
+ void mono_debugger_install_sequence_point_check (uint32_t * check )
1165
+ {
1166
+ g_unity_check = check ;
1167
+ }
1168
+
1169
+ #define INC_PAUSE_COUNT () do { mono_atomic_inc_i32 (g_unity_check); } while (0)
1170
+ #define DEC_PAUSE_COUNT () do { mono_atomic_dec_i32 (g_unity_check); } while (0)
1171
+
1172
+ #else
1173
+
1174
+ #define INC_PAUSE_COUNT ()
1175
+ #define DEC_PAUSE_COUNT ()
1176
+
1163
1177
#endif // RUNTIME_IL2CPP
1164
1178
1165
1179
/*
@@ -3430,7 +3444,7 @@ compute_frame_info (MonoInternalThread *thread, DebuggerTlsData *tls)
3430
3444
} else if (tls -> il2cpp_context -> frameCount > 0 ) {
3431
3445
for (int frame_index = tls -> il2cpp_context -> frameCount - 1 ; frame_index >= 0 ; -- frame_index )
3432
3446
{
3433
- Il2CppSequencePoint * seq_point = tls -> il2cpp_context -> executionContexts [frame_index ]-> currentSequencePoint ;
3447
+ Il2CppSequencePoint * seq_point = il2cpp_get_sequence_point ( tls -> il2cpp_context -> executionContexts [frame_index ]-> currentSequencePoint ) ;
3434
3448
StackFrame * frame = g_new0 (StackFrame , 1 );
3435
3449
MonoMethod * sp_method = il2cpp_get_seq_point_method (seq_point );
3436
3450
frame -> method = sp_method ;
@@ -4836,6 +4850,7 @@ set_breakpoint (MonoMethod *method, long il_offset, EventRequest *req, MonoError
4836
4850
inst -> seq_point = seqPoint ;
4837
4851
4838
4852
seqPoint -> isActive ++ ;
4853
+ INC_PAUSE_COUNT ();
4839
4854
4840
4855
mono_loader_lock ();
4841
4856
g_ptr_array_add (bp -> children , inst );
@@ -4925,6 +4940,7 @@ static MonoBreakpoint* set_breakpoint_fast(Il2CppSequencePoint *sp, EventRequest
4925
4940
inst -> seq_point = sp ;
4926
4941
4927
4942
sp -> isActive ++ ;
4943
+ INC_PAUSE_COUNT ();
4928
4944
4929
4945
mono_loader_lock ();
4930
4946
g_ptr_array_add (bp -> children , inst );
@@ -4961,6 +4977,7 @@ clear_breakpoint (MonoBreakpoint *bp)
4961
4977
remove_breakpoint (inst );
4962
4978
#else
4963
4979
inst -> seq_point -> isActive -- ;
4980
+ DEC_PAUSE_COUNT ();
4964
4981
#endif
4965
4982
4966
4983
g_free (inst );
@@ -5038,6 +5055,7 @@ clear_breakpoints_for_domain (MonoDomain *domain)
5038
5055
remove_breakpoint (inst );
5039
5056
#else
5040
5057
inst -> seq_point -> isActive -- ;
5058
+ DEC_PAUSE_COUNT ();
5041
5059
#endif
5042
5060
5043
5061
g_free (inst );
@@ -5854,7 +5872,7 @@ process_single_step_inner (DebuggerTlsData *tls, gboolean from_signal, int seque
5854
5872
#ifndef RUNTIME_IL2CPP
5855
5873
process_event (EVENT_KIND_STEP , jinfo_get_method (ji ), il_offset , ctx , events , suspend_policy );
5856
5874
#else
5857
- Il2CppSequencePoint * sequence_pt = tls -> il2cpp_context -> executionContexts [tls -> il2cpp_context -> frameCount - 1 ]-> currentSequencePoint ;
5875
+ Il2CppSequencePoint * sequence_pt = il2cpp_get_sequence_point ( tls -> il2cpp_context -> executionContexts [tls -> il2cpp_context -> frameCount - 1 ]-> currentSequencePoint ) ;
5858
5876
MonoMethod * sp_method = il2cpp_get_seq_point_method (sequence_pt );
5859
5877
5860
5878
/*
@@ -5998,6 +6016,7 @@ start_single_stepping (void)
5998
6016
{
5999
6017
#ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED
6000
6018
int val = mono_atomic_inc_i32 (& ss_count );
6019
+ INC_PAUSE_COUNT ();
6001
6020
6002
6021
if (val == 1 ) {
6003
6022
mono_arch_start_single_stepping ();
@@ -6015,6 +6034,7 @@ stop_single_stepping (void)
6015
6034
{
6016
6035
#ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED
6017
6036
int val = mono_atomic_dec_i32 (& ss_count );
6037
+ DEC_PAUSE_COUNT ();
6018
6038
6019
6039
if (val == 0 ) {
6020
6040
mono_arch_stop_single_stepping ();
@@ -6443,7 +6463,7 @@ ss_start_il2cpp(SingleStepReq *ss_req, DebuggerTlsData *tls, Il2CppSequencePoint
6443
6463
} else {
6444
6464
if (ss_req -> depth == STEP_DEPTH_OVER )
6445
6465
{
6446
- MonoMethod * currentMethod = il2cpp_get_seq_point_method (tls -> il2cpp_context -> executionContexts [tls -> il2cpp_context -> frameCount - 1 ]-> currentSequencePoint );
6466
+ MonoMethod * currentMethod = il2cpp_get_seq_point_method (il2cpp_get_sequence_point ( tls -> il2cpp_context -> executionContexts [tls -> il2cpp_context -> frameCount - 1 ]-> currentSequencePoint ) );
6447
6467
6448
6468
void * seqPointIter = NULL ;
6449
6469
Il2CppSequencePoint * seqPoint ;
@@ -6459,7 +6479,7 @@ ss_start_il2cpp(SingleStepReq *ss_req, DebuggerTlsData *tls, Il2CppSequencePoint
6459
6479
6460
6480
if (tls -> il2cpp_context -> frameCount > 1 )
6461
6481
{
6462
- Il2CppSequencePoint * sequencePointForStepOut = tls -> il2cpp_context -> executionContexts [tls -> il2cpp_context -> frameCount - 2 ]-> currentSequencePoint ;
6482
+ Il2CppSequencePoint * sequencePointForStepOut = il2cpp_get_sequence_point ( tls -> il2cpp_context -> executionContexts [tls -> il2cpp_context -> frameCount - 2 ]-> currentSequencePoint ) ;
6463
6483
g_assert (sequencePointForStepOut -> kind == kSequencePointKind_StepOut );
6464
6484
ss_bp_add_one_il2cpp (ss_req , & ss_req_bp_count , & ss_req_bp_cache , sequencePointForStepOut );
6465
6485
}
@@ -6528,6 +6548,7 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, StepFilte
6528
6548
DEBUG_PRINTF (1 , "[dbg] Starting single step of thread %p (depth=%s).\n" , thread , ss_depth_to_string (depth ));
6529
6549
6530
6550
ss_req = g_new0 (SingleStepReq , 1 );
6551
+ INC_PAUSE_COUNT ();
6531
6552
ss_req -> req = req ;
6532
6553
ss_req -> thread = thread ;
6533
6554
ss_req -> size = size ;
@@ -6553,7 +6574,7 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, StepFilte
6553
6574
6554
6575
if (tls -> il2cpp_context -> frameCount > 0 )
6555
6576
{
6556
- Il2CppSequencePoint * seq_point = tls -> il2cpp_context -> executionContexts [tls -> il2cpp_context -> frameCount - 1 ]-> currentSequencePoint ;
6577
+ Il2CppSequencePoint * seq_point = il2cpp_get_sequence_point ( tls -> il2cpp_context -> executionContexts [tls -> il2cpp_context -> frameCount - 1 ]-> currentSequencePoint ) ;
6557
6578
MonoMethod * sp_method = il2cpp_get_seq_point_method (seq_point );
6558
6579
ss_req -> start_method = sp_method ;
6559
6580
ss_req -> last_method = sp_method ;
@@ -6669,6 +6690,7 @@ ss_destroy (SingleStepReq *req)
6669
6690
ss_stop (ss_req );
6670
6691
6671
6692
g_free (ss_req );
6693
+ DEC_PAUSE_COUNT ();
6672
6694
ss_req = NULL ;
6673
6695
}
6674
6696
@@ -6788,7 +6810,7 @@ static Il2CppSequencePoint* il2cpp_find_catch_sequence_point(DebuggerTlsData *tl
6788
6810
int frameIndex = tls -> il2cpp_context -> frameCount - 1 ;
6789
6811
while (frameIndex >= 0 )
6790
6812
{
6791
- Il2CppSequencePoint * sp = il2cpp_find_catch_sequence_point_in_method (tls -> il2cpp_context -> executionContexts [frameIndex ]-> currentSequencePoint , tls -> exception );
6813
+ Il2CppSequencePoint * sp = il2cpp_find_catch_sequence_point_in_method (il2cpp_get_sequence_point ( tls -> il2cpp_context -> executionContexts [frameIndex ]-> currentSequencePoint ) , tls -> exception );
6792
6814
if (sp )
6793
6815
return sp ;
6794
6816
@@ -6812,7 +6834,7 @@ static Il2CppSequencePoint* il2cpp_find_catch_sequence_point_from_exeption(Debug
6812
6834
int frameIndex = tls -> il2cpp_context -> frameCount - 1 ;
6813
6835
while (frameIndex >= 0 )
6814
6836
{
6815
- sp = il2cpp_find_catch_sequence_point_in_method (tls -> il2cpp_context -> executionContexts [frameIndex ]-> currentSequencePoint , exc );
6837
+ sp = il2cpp_find_catch_sequence_point_in_method (il2cpp_get_sequence_point ( tls -> il2cpp_context -> executionContexts [frameIndex ]-> currentSequencePoint ) , exc );
6816
6838
if (sp )
6817
6839
return sp ;
6818
6840
0 commit comments