public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH 5/5] Make gdb_test's question non-optional if specified
Date: Tue, 17 May 2022 13:04:14 +0100	[thread overview]
Message-ID: <afbd99e4-387b-115b-8049-6baa13cf7abe@palves.net> (raw)
In-Reply-To: <b18590c4-0ec4-b4f1-22b0-22a337974ef1@simark.ca>

On 2022-05-17 12:41, Simon Marchi wrote:

> I see this failure starting with this patch:
> 
>   $ make check TESTS="gdb.python/py-connection.exp" RUNTESTFLAGS="--target_board=native-gdbserver"
>   (gdb) PASS: gdb.python/py-connection.exp: info connections while the connection is still around
>   disconnect^M
>   Ending remote debugging.^M
>   (gdb) FAIL: gdb.python/py-connection.exp: kill the inferior
> 

Thanks, I've pushed the patch below to fix it.

From a1f2ddd38378c8db63e75daa28b7e304c2fd774f Mon Sep 17 00:00:00 2001
From: Pedro Alves <pedro@palves.net>
Date: Tue, 17 May 2022 12:53:32 +0100
Subject: [PATCH] Fix gdb.python/py-connection.exp with remote targets

After the patch to make gdb_test's question non-optional when
specified, gdb.python/py-connection.exp started failing like so:

  $ make check TESTS="gdb.python/py-connection.exp" RUNTESTFLAGS="--target_board=native-gdbserver"
  (gdb) PASS: gdb.python/py-connection.exp: info connections while the connection is still around
  disconnect^M
  Ending remote debugging.^M
  (gdb) FAIL: gdb.python/py-connection.exp: kill the inferior

The problem is that "disconnect" when debugging with the native target
asks the user whether to kill the program, while with remote targets,
it doesn't.

Fix it by explicitly killing before disconnecting.

Tested with --target_board unix, native-gdbserver, and native-extended-gdbserver.

Change-Id: Icd85015c76deb84b71894715d43853c1087eba0b
---
 gdb/testsuite/gdb.python/py-connection.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.python/py-connection.exp b/gdb/testsuite/gdb.python/py-connection.exp
index c56aba33e4c..91315eb1af4 100644
--- a/gdb/testsuite/gdb.python/py-connection.exp
+++ b/gdb/testsuite/gdb.python/py-connection.exp
@@ -55,8 +55,8 @@ gdb_test "python print('Same object: %s' % (conn is conn2))" "True"
 # starts to return False.
 gdb_test "info connections" "\r\n\\* 1 .*" \
     "info connections while the connection is still around"
-gdb_test "disconnect" "" "kill the inferior" \
-    "A program is being debugged already\\.  Kill it\\? .*y or n. $" "y"
+gdb_test "with confirm off -- kill" "" "kill inferior"
+gdb_test "disconnect"
 gdb_test "info connections" "No connections\\." \
     "info connections now all the connections have gone"
 gdb_test "python print(conn)" "<gdb.${connection_type} \\(invalid\\)>" \

base-commit: 49a73ab9d345e1cd412a93b34a0b8c166603d80e
-- 
2.36.0


  reply	other threads:[~2022-05-17 12:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 19:29 [PATCH 0/5] " Pedro Alves
2022-03-30 19:29 ` [PATCH 1/5] Remove gdb_test questions that GDB doesn't ask Pedro Alves
2022-03-30 19:29 ` [PATCH 2/5] gdb.base/scope.exp: Remove bogus gdb_test questions Pedro Alves
2022-03-30 19:29 ` [PATCH 3/5] Fix bogus gdb_test invocations Pedro Alves
2022-03-30 19:29 ` [PATCH 4/5] Avoid having to unload file in gdb.server/connect-with-no-symbol-file.exp Pedro Alves
2022-03-30 19:29 ` [PATCH 5/5] Make gdb_test's question non-optional if specified Pedro Alves
2022-04-07 20:31   ` Bruno Larsen
2022-04-08 12:18     ` Pedro Alves
2022-05-17 10:13       ` [PATCH 5/6] gdb.base/skip.exp: Don't abuse gdb_test's question support (Re: [PATCH 5/5] Make gdb_test's question non-optional if specified) Pedro Alves
2022-05-16 16:01   ` [PATCH 5/5] Make gdb_test's question non-optional if specified Tom Tromey
2022-05-17 11:25     ` Pedro Alves
2022-05-17 22:48       ` Tom Tromey
2022-05-18 11:01         ` [pushed] Support -prompt and -lbl in gdb_test (Re: [PATCH 5/5] Make gdb_test's question non-optional if specified) Pedro Alves
2022-05-18 12:15           ` Tom de Vries
2022-05-18 12:36             ` Pedro Alves
2022-05-18 14:13               ` Pedro Alves
2022-05-18 14:49                 ` Tom de Vries
2022-05-18 20:34                 ` Tom Tromey
2022-05-19 12:42                   ` Pedro Alves
2022-05-23 10:48           ` Tom de Vries
2022-05-23 12:01             ` Tom de Vries
2022-05-23 12:50               ` [committed][gdb/testsuite] Fix -prompt handling in gdb_test Tom de Vries
2022-05-23 12:53               ` [pushed] Support -prompt and -lbl in gdb_test (Re: [PATCH 5/5] Make gdb_test's question non-optional if specified) Pedro Alves
2022-05-17 11:41   ` [PATCH 5/5] Make gdb_test's question non-optional if specified Simon Marchi
2022-05-17 12:04     ` Pedro Alves [this message]
2022-05-16 16:02 ` [PATCH 0/5] " Tom Tromey

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=afbd99e4-387b-115b-8049-6baa13cf7abe@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).