public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Allow 'interrupt -a' in all-stop mode
@ 2022-06-08 15:27 Tom Tromey
  2022-06-09 15:40 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2022-06-08 15:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

PR gdb/17160 points out that "interrupt -a" errors in all-stop mode,
but there's no good reason for this.  This patch removes the error.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=17160
---
 gdb/infcmd.c                                |  3 --
 gdb/testsuite/gdb.base/interrupt-daemon.exp | 36 +++++++++++----------
 2 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index e909d4d4c81..18590259339 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -2874,9 +2874,6 @@ interrupt_command (const char *args, int from_tty)
 	  && startswith (args, "-a"))
 	all_threads = 1;
 
-      if (!non_stop && all_threads)
-	error (_("-a is meaningless in all-stop mode."));
-
       interrupt_target_1 (all_threads);
     }
 }
diff --git a/gdb/testsuite/gdb.base/interrupt-daemon.exp b/gdb/testsuite/gdb.base/interrupt-daemon.exp
index 0c71a6df71c..8dcbf778222 100644
--- a/gdb/testsuite/gdb.base/interrupt-daemon.exp
+++ b/gdb/testsuite/gdb.base/interrupt-daemon.exp
@@ -58,28 +58,30 @@ proc do_test {} {
 	}
     }
 
-    with_test_prefix "bg" {
-
-	set test "continue&"
-	gdb_test_multiple "continue&" $test {
-	    -re "Continuing\\.\r\n$gdb_prompt " {
-		pass $test
+    foreach arg {"" "-a"} {
+	with_test_prefix "bg$arg" {
+
+	    set test "continue&"
+	    gdb_test_multiple "continue&" $test {
+		-re "Continuing\\.\r\n$gdb_prompt " {
+		    pass $test
+		}
 	    }
-	}
 
-	after 200
+	    after 200
 
-	set test "interrupt"
-	gdb_test_multiple $test $test {
-	    -re "$gdb_prompt " {
-		pass $test
+	    set test "interrupt $arg"
+	    gdb_test_multiple $test $test {
+		-re "$gdb_prompt " {
+		    pass $test
+		}
 	    }
-	}
 
-	set test "interrupt cmd stops process"
-	gdb_test_multiple "" $test {
-	    -re "received signal SIGINT" {
-		pass $test
+	    set test "interrupt cmd stops process"
+	    gdb_test_multiple "" $test {
+		-re "received signal SIGINT" {
+		    pass $test
+		}
 	    }
 	}
     }
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-14 15:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 15:27 [PATCH] Allow 'interrupt -a' in all-stop mode Tom Tromey
2022-06-09 15:40 ` Pedro Alves
2022-06-10 15:52   ` Tom Tromey
2022-06-13 14:10     ` Pedro Alves
2022-06-14 15:04       ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).