From 58f076c6f86dc8361f2e6a6c67940fd9b5ad9a60 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 8 Jun 2021 15:36:46 +0200 Subject: [gdb/testsuite] Simplify gdb.base/info-types.exp.tcl further After adding support for --any in match_line, we can simplify gdb.base/info-types.exp.tcl further: we can add the "All defined types:" regexp in the output_lines list: ... set output_lines \ [list \ + "All defined types:" \ + "--any" \ $file_re \ ... Consequently, we can simplify the state machine to track a variable "found" with values: - 0 (unmatched) - 1 (matched) - -1 (mismatch). This makes the code generic enough to factor out into a new proc gdb_test_lines. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-06-08 Tom de Vries * gdb.base/info-types.exp.tcl (match_line): Handle --any. (gdb_test_lines): Factor out of ... (run_test): ... here. --- gdb/testsuite/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gdb/testsuite/ChangeLog') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index cd62633..06880fa 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2021-06-08 Tom de Vries + * gdb.base/info-types.exp.tcl (match_line): Handle --any. + (gdb_test_lines): Factor out of ... + (run_test): ... here. + +2021-06-08 Tom de Vries + * gdb.base/batch-preserve-term-settings.exp (spawn_shell): Fix matching of initial prompt. -- cgit v1.1