@@ -3519,7 +3519,7 @@ compute_frame_info_from (MonoInternalThread *thread, DebuggerTlsData *tls, MonoT
3519
3519
}
3520
3520
3521
3521
static void
3522
- compute_frame_info (MonoInternalThread * thread , DebuggerTlsData * tls )
3522
+ compute_frame_info (MonoInternalThread * thread , DebuggerTlsData * tls , gboolean force_update )
3523
3523
{
3524
3524
ComputeFramesUserData user_data ;
3525
3525
GSList * tmp ;
@@ -3528,7 +3528,7 @@ compute_frame_info (MonoInternalThread *thread, DebuggerTlsData *tls)
3528
3528
MonoUnwindOptions opts = (MonoUnwindOptions )(MONO_UNWIND_DEFAULT | MONO_UNWIND_REG_LOCATIONS );
3529
3529
3530
3530
// FIXME: Locking on tls
3531
- if (tls -> frames && tls -> frames_up_to_date )
3531
+ if (tls -> frames && tls -> frames_up_to_date && ! force_update )
3532
3532
return ;
3533
3533
3534
3534
DEBUG_PRINTF (1 , "Frames for %p(tid=%lx):\n" , thread , thread -> tid );
@@ -5211,7 +5211,7 @@ static void ss_calculate_framecount (DebuggerTlsData *tls, MonoContext *ctx)
5211
5211
{
5212
5212
if (!tls -> context .valid )
5213
5213
mono_thread_state_init_from_monoctx (& tls -> context , ctx );
5214
- compute_frame_info (tls -> thread , tls );
5214
+ compute_frame_info (tls -> thread , tls , FALSE );
5215
5215
}
5216
5216
5217
5217
static gboolean
@@ -6533,7 +6533,7 @@ ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint* sp, MonoSeqPointI
6533
6533
mono_loader_lock ();
6534
6534
locked = TRUE;
6535
6535
6536
- compute_frame_info (tls -> thread , tls );
6536
+ compute_frame_info (tls -> thread , tls , FALSE );
6537
6537
frames = tls -> frames ;
6538
6538
nframes = tls -> frame_count ;
6539
6539
}
@@ -6866,7 +6866,7 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, StepFilte
6866
6866
if (frames && nframes )
6867
6867
frame = frames [0 ];
6868
6868
} else {
6869
- compute_frame_info (thread , tls );
6869
+ compute_frame_info (thread , tls , FALSE );
6870
6870
6871
6871
if (tls -> frame_count )
6872
6872
frame = tls -> frames [0 ];
@@ -11189,7 +11189,7 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
11189
11189
if (tls == NULL )
11190
11190
return ERR_UNLOADED ;
11191
11191
11192
- compute_frame_info (thread , tls );
11192
+ compute_frame_info (thread , tls , TRUE); //the last parameter is TRUE to force that the frame info that will be send is synchronised with the debugged thread
11193
11193
11194
11194
buffer_add_int (buf , tls -> frame_count );
11195
11195
for (i = 0 ; i < tls -> frame_count ; ++ i ) {
@@ -11246,7 +11246,7 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
11246
11246
mono_loader_unlock ();
11247
11247
g_assert (tls );
11248
11248
11249
- compute_frame_info (thread , tls );
11249
+ compute_frame_info (thread , tls , FALSE );
11250
11250
if (tls -> frame_count == 0 || tls -> frames [0 ]-> actual_method != method )
11251
11251
return ERR_INVALID_ARGUMENT ;
11252
11252
@@ -11350,6 +11350,9 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
11350
11350
if (i == tls -> frame_count )
11351
11351
return ERR_INVALID_FRAMEID ;
11352
11352
11353
+ /* The thread is still running native code, can't get frame variables info */
11354
+ if (!tls -> really_suspended && !tls -> async_state .valid )
11355
+ return ERR_NOT_SUSPENDED ;
11353
11356
frame_idx = i ;
11354
11357
frame = tls -> frames [frame_idx ];
11355
11358
0 commit comments