[RFC,6/7] gdb/infrun: solo thread resume in replay diversion

Message ID 60b68727.1c69fb81.bcdc1.5245SMTPIN_ADDED_BROKEN@mx.google.com
State New
Headers show
Series
  • gdb: replay diversion support
Related show

Commit Message

Tom de Vries via Gdb-patches June 1, 2021, 7:11 p.m.
Treat 'scheduler-locking = replay' similarly to 'scheduler-locking =
on' when in a replay diversion.

gdb/ChangeLog:

2021-06-01  George Barrett  <bob@bob131.so>

	* infrun.c (user_visible_resume_ptid): Do solo thread
	resumption if the scheduler mode is 'replay' and the target is
	in a replay diversion.
---
 gdb/infrun.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
2.31.1

Patch

diff --git a/gdb/infrun.c b/gdb/infrun.c
index 58ed3e92161..b9e0236f52a 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2088,6 +2088,16 @@  user_visible_resume_ptid (int step)
 	 mode.  */
       resume_ptid = inferior_ptid;
     }
+  else if ((scheduler_mode == schedlock_replay)
+	   && target_in_replay_diversion ())
+    {
+      /* User-settable 'scheduler' mode requires solo thread resume in
+	 replay mode during a replay diversion.  This prevents GDB
+	 from unintentionally asking the target to resume replay of
+	 another thread when performing an inferior call in the
+	 current thread, for example.  */
+      resume_ptid = inferior_ptid;
+    }
   else if (!sched_multi && target_supports_multi_process ())
     {
       /* Resume all threads of the current process (and none of other