public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Make gdb_test's question non-optional if specified
@ 2022-03-30 19:29 Pedro Alves
  2022-03-30 19:29 ` [PATCH 1/5] Remove gdb_test questions that GDB doesn't ask Pedro Alves
                   ` (5 more replies)
  0 siblings, 6 replies; 26+ messages in thread
From: Pedro Alves @ 2022-03-30 19:29 UTC (permalink / raw)
  To: gdb-patches

gdb_test supports handling scenarios where GDB asks a question before
finishing handling some command.  The full prototype of gdb_test is:

  # gdb_test COMMAND PATTERN MESSAGE QUESTION RESPONSE

However, QUESTION is a question that GDB _may_ ask, not one that GDB
_must_ ask:

 # QUESTION is a question GDB may ask in response to COMMAND, like
 #   "are you sure?"
 # RESPONSE is the response to send if QUESTION appears.

If GDB doesn't raise the question, the test still passes.

I think that this is a misfeature.  If GDB regresses and stops asking
a question, the testsuite won't notice.  So I think that if a QUESTION
is specified, gdb_test should ensure it comes out of GDB.

Running the testsuite exposes a number of tests that pass
QUESTION/RESPONSE to GDB, but no question comes out.  This series
fixes them all.

A related issue is that gdb_test doesn't enforce that if you specify
QUESTION, that you also specify RESPONSE.  I.e., you should pass 1, 2,
3, or 5 arguments to gdb_test, but never 4, or more than 5.  Making
gdb_test detect bogus arguments actually regresses some testcases,
exposing test bugs, also fixed in this series.

gdb_test's behavior is changed in the last patch of the series.

Pedro Alves (5):
  Remove gdb_test questions that GDB doesn't ask
  gdb.base/scope.exp: Remove bogus gdb_test questions
  Fix bogus gdb_test invocations
  Avoid having to unload file in
    gdb.server/connect-with-no-symbol-file.exp
  Make gdb_test's question non-optional if specified

 gdb/testsuite/gdb.base/auxv.exp               |  3 +-
 gdb/testsuite/gdb.base/catch-fork-kill.exp    |  3 +-
 gdb/testsuite/gdb.base/default.exp            |  2 +-
 gdb/testsuite/gdb.base/pointers.exp           |  2 +-
 gdb/testsuite/gdb.base/scope.exp              | 60 +++++++++----------
 gdb/testsuite/gdb.base/style.exp              |  4 +-
 gdb/testsuite/gdb.multi/tids.exp              |  2 +-
 gdb/testsuite/gdb.python/py-parameter.exp     |  2 +-
 gdb/testsuite/gdb.python/py-xmethods.exp      |  1 +
 .../connect-with-no-symbol-file.exp           | 17 +++---
 gdb/testsuite/gdb.server/solib-list.exp       |  3 +-
 gdb/testsuite/lib/gdb.exp                     | 25 ++++++--
 12 files changed, 67 insertions(+), 57 deletions(-)


base-commit: c50e54825bfea1ab6afbd984a4d2e78e9306e70f
-- 
2.26.2


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

end of thread, other threads:[~2022-05-23 12:53 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 19:29 [PATCH 0/5] Make gdb_test's question non-optional if specified 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
2022-05-16 16:02 ` [PATCH 0/5] " 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).