public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix gdb.python/py-connection.exp with remote targets
@ 2022-05-17 12:03 Pedro Alves
0 siblings, 0 replies; only message in thread
From: Pedro Alves @ 2022-05-17 12:03 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a1f2ddd38378c8db63e75daa28b7e304c2fd774f
commit a1f2ddd38378c8db63e75daa28b7e304c2fd774f
Author: Pedro Alves <pedro@palves.net>
Date: Tue May 17 12:53:32 2022 +0100
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
Diff:
---
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\\)>" \
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-17 12:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 12:03 [binutils-gdb] Fix gdb.python/py-connection.exp with remote targets Pedro Alves
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).