]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
btrace: do not allow moving running threads with 'record goto'
authorMarkus Metzger <markus.t.metzger@intel.com>
Wed, 13 Aug 2025 14:38:10 +0000 (14:38 +0000)
committerMarkus Metzger <markus.t.metzger@intel.com>
Mon, 3 Nov 2025 06:22:46 +0000 (06:22 +0000)
With asynchronous commands, a thread can be replaying in the background
while it is being moved using the 'record goto' command in the foreground.

Do not allow that.

gdb/record-btrace.c

index 1534b76de77518ecb19b448d31a2c65198f9797b..6308808f4139d0490ef44b0e710f30dac697eadf 100644 (file)
@@ -2847,6 +2847,9 @@ record_btrace_set_replay (struct thread_info *tp,
 {
   struct btrace_thread_info *btinfo;
 
+  if (tp->state == THREAD_RUNNING)
+    error (_("You cannot do that while the thread is running."));
+
   btinfo = &tp->btrace;
 
   if (it == NULL)