From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by sourceware.org (Postfix) with ESMTPS id 3486F385E449 for ; Wed, 30 Mar 2022 19:29:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3486F385E449 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f42.google.com with SMTP id b19so30682402wrh.11 for ; Wed, 30 Mar 2022 12:29:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=TvvoWfWrc7ODjAmNRuIbkS49qw4DY4adc97/vxtzQWQ=; b=LszmXj3ndlzPMKf/9C98T8YD7CXTSBKtHiSWCUjGlJX/f/75+1cKZplF3cSNIq9HIS JapACeK4HfNJtItrcyg3U2BttS66hJQQHwmF1QcTL99ZaHfGYdqv1GxD6B0a1pCKwENN 1rp1Mb0s716A6QK4VZpTz78qLMeswk8Qe8rMcutp1Mung7VBEfByKqkJ1n+u2pS1Pbmi JpLGZkiqJ9eE+EU9k8LrgO1LCRcvsSLiLnJdnKYSecI0/VZsKuR0Yv/GQ2bzW2g7k2jj yNkrq/SPL7QoorynD7KOwfOZm8aDb0rMlsj5rG2Oq+Oi6Ins4+gS5KTSsS3lELXK3PO2 HCIw== X-Gm-Message-State: AOAM53212cWMQ6ICzlbiIL2cSJzCBnebwVaObuGMn7MAmJzpErGK9Oim NayN3/OzCpqOCI/9zJ3j/l4uiKsBLXY= X-Google-Smtp-Source: ABdhPJzO05mmmBunKQqwuaD7KfpC6EDPYTqAfPFwu+3GgJRDULC0p32vW1IfHMCG4z8v+07vfFQ1sA== X-Received: by 2002:a05:6000:10cf:b0:203:d8da:129c with SMTP id b15-20020a05600010cf00b00203d8da129cmr1044383wrx.300.1648668571535; Wed, 30 Mar 2022 12:29:31 -0700 (PDT) Received: from localhost ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id f13-20020a05600c4e8d00b0038c949ef0d5sm6132413wmq.8.2022.03.30.12.29.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Mar 2022 12:29:30 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 0/5] Make gdb_test's question non-optional if specified Date: Wed, 30 Mar 2022 20:29:24 +0100 Message-Id: <20220330192929.3161015-1-pedro@palves.net> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2022 19:29:34 -0000 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