From: Mohamed Bouhaouel <mohamed.bouhaouel@intel.com>
To: gdb-patches@sourceware.org
Cc: markus.t.metzger@intel.com, stephan.rohr@intel.com,
aburgess@redhat.com, mohamed.bouhaouel@intel.com
Subject: [PATCH v2 08/11] gdb, testsuite: handle async close in monitor-exit-quit.exp
Date: Thu, 11 Jun 2026 17:32:28 +0200 [thread overview]
Message-ID: <20260611153232.3011-9-mohamed.bouhaouel@intel.com> (raw)
In-Reply-To: <20260611153232.3011-1-mohamed.bouhaouel@intel.com>
From: "Bouhaouel, Mohamed" <mohamed.bouhaouel@intel.com>
With non-stop remote targets, the "Remote connection closed"
notification arrives asynchronously after "monitor exit" and may appear
while processing the quit command, causing test failures.
Fix by using "with confirm off -- quit" and handling the async
notification in the quit sequence.
---
gdb/testsuite/gdb.server/monitor-exit-quit.exp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.server/monitor-exit-quit.exp b/gdb/testsuite/gdb.server/monitor-exit-quit.exp
index cb90169ef0c..f0db907576e 100644
--- a/gdb/testsuite/gdb.server/monitor-exit-quit.exp
+++ b/gdb/testsuite/gdb.server/monitor-exit-quit.exp
@@ -50,11 +50,16 @@ set gdbserver_gdbport [lindex $res 1]
gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport
gdb_test_no_output "monitor exit"
-gdb_test_no_output "set confirm off"
set do_cleanup 1
-gdb_test_multiple "quit" "" {
+gdb_test_multiple "with confirm off -- quit" "" {
+ -re -wrap "Remote connection closed.*" {
+ # With non-stop remote targets, the "Remote connection closed"
+ # notification is delivered asynchronously and may appear while
+ # processing the quit command.
+ exp_continue
+ }
-re -wrap "" {
fail "$gdb_test_name (prompt)"
# Let default_gdb_exit do the cleanup.
--
2.43.0
Intel Deutschland GmbH
Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2026-06-11 15:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 15:32 [PATCH v2 00/11] Enable non-stop mode by default for remote targets Mohamed Bouhaouel
2026-06-11 15:32 ` [PATCH v2 01/11] gdb, record: fix assertion when remote target is set to non-stop Mohamed Bouhaouel
2026-06-11 15:32 ` [PATCH v2 02/11] gdb, remote: fix assertion on reconnect to non-stop target Mohamed Bouhaouel
2026-06-11 15:32 ` [PATCH v2 03/11] gdb, remote: fix async handler " Mohamed Bouhaouel
2026-06-11 15:32 ` [PATCH v2 04/11] gdb, remote: fix "info program" after " Mohamed Bouhaouel
2026-06-11 15:32 ` [PATCH v2 05/11] gdb, remote: fix crash when accessing removed events Mohamed Bouhaouel
2026-06-11 15:32 ` [PATCH v2 06/11] gdb, remote: fix ptid matching for process-wide stop events Mohamed Bouhaouel
2026-06-11 15:32 ` [PATCH v2 07/11] gdb, dap: fix DAP events if no thread is selected Mohamed Bouhaouel
2026-06-11 15:32 ` Mohamed Bouhaouel [this message]
2026-06-11 15:32 ` [PATCH v2 09/11] gdb, testsuite: update attach-deleted-exec.exp to handle async messages Mohamed Bouhaouel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260611153232.3011-9-mohamed.bouhaouel@intel.com \
--to=mohamed.bouhaouel@intel.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=markus.t.metzger@intel.com \
--cc=stephan.rohr@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox