Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/2] [gdb/testsuite] Clean up in gdb.multi/checkpoint-multi.exp
Date: Sun, 27 Sep 2026 06:57:21 +0200	[thread overview]
Message-ID: <20260927045721.1976335-3-tdevries@suse.de> (raw)
In-Reply-To: <20260927045721.1976335-1-tdevries@suse.de>

I noticed in gdb.multi/checkpoint-multi.exp that when an inferior is detached,
the process is not cleaned up.

Fix this by re-attaching and killing it.
---
 gdb/testsuite/gdb.multi/checkpoint-multi.exp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gdb/testsuite/gdb.multi/checkpoint-multi.exp b/gdb/testsuite/gdb.multi/checkpoint-multi.exp
index ac9890682c1..4dcb579bf4a 100644
--- a/gdb/testsuite/gdb.multi/checkpoint-multi.exp
+++ b/gdb/testsuite/gdb.multi/checkpoint-multi.exp
@@ -148,7 +148,13 @@ proc start_2_inferiors_checkpoint_on_inf_2_alt {} {
 
 with_test_prefix "check detach on non-checkpointed inferior" {
     start_2_inferiors_checkpoint_on_inf_2
+    set pid [get_inferior_pid]
     gdb_test "detach" "Detaching from program.*$::exec1.*Inferior 1.*detached.*"
+    with_test_prefix cleanup {
+	gdb_test "inferior 1" "Switching to inferior 1 .*"
+	gdb_test "attach $pid" "Attaching to program: .*" "re-attach for kill"
+	gdb_test_kill "kill" 1
+    }
 }
 
 with_test_prefix "check kill on non-checkpointed inferior" {
-- 
2.51.0


      parent reply	other threads:[~2026-09-27  4:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27  4:57 [PATCH 0/2] " Tom de Vries
2026-09-27  4:57 ` [PATCH 1/2] [gdb/testsuite] Factor out gdb_test_kill Tom de Vries
2026-09-28 11:01   ` Andrew Burgess
2026-09-27  4:57 ` Tom de Vries [this message]

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=20260927045721.1976335-3-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /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