From 9a8c16ee84879c8f1abbc7d9b8f85a27d74288c1 Mon Sep 17 00:00:00 2001 From: Markus Metzger Date: Wed, 13 Aug 2025 14:38:10 +0000 Subject: [PATCH] btrace: do not allow moving running threads with 'record goto' 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index 1534b76de77..6308808f413 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -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) -- 2.47.3