From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 0170A3858C66; Mon, 13 Mar 2023 16:20:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0170A3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678724420; bh=fwy865ywjYGHjNCnjZasve3nBplMmhrAibE+1Y9dslU=; h=From:To:Subject:Date:From; b=Y28CzlD8qo38gP1B+58dPUH1VjWbEj2Kk92mlqVHeaVDGDsf6uVIRPK+ZiqtpD1+M lRKFUcTbG2yws5kyvMVdU/34d1kT/FyfoXISjh/GEGFFhCO7BDROprTmEJ2gc46kGT f7b+fhobwoG7fh7ajjI/SrDZ2sfd8KXzUeURGf9g= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Handle USE_TUI in gdb.tui/corefile-run.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: ed7d5797b56e8b771d5f7553738f790819d96b6f X-Git-Newrev: 6b81ded4876cb836e5fd7d8bc2459fef99dcac70 Message-Id: <20230313162020.0170A3858C66@sourceware.org> Date: Mon, 13 Mar 2023 16:20:19 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6b81ded4876c= b836e5fd7d8bc2459fef99dcac70 commit 6b81ded4876cb836e5fd7d8bc2459fef99dcac70 Author: Tom de Vries Date: Mon Mar 13 17:20:09 2023 +0100 [gdb/testsuite] Handle USE_TUI in gdb.tui/corefile-run.exp =20 Once in a while I find myself rewriting a TUI test-case into a non-TUI test-case, to better understand whether the problem I'm looking at is related to the TUI or not. =20 I've got the impression that I've done this sufficiently often that it'= s worth committing the non-TUI version, so having just written a non-TUI versio= n of gdb.tui/corefile-run.exp, let's commit it. =20 The non-TUI version can be enabled by doing: ... $ make check "RUNTESTFLAGS=3Dgdb.tui/corefile-run.exp USE_TUI=3D0" ... =20 Also remove hard-coding of a source line number. =20 Tested on x86_64-linux. Diff: --- gdb/testsuite/gdb.tui/corefile-run.exp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.tui/corefile-run.exp b/gdb/testsuite/gdb.tui= /corefile-run.exp index 2109a0ae3eb..6769dfbd800 100644 --- a/gdb/testsuite/gdb.tui/corefile-run.exp +++ b/gdb/testsuite/gdb.tui/corefile-run.exp @@ -40,6 +40,19 @@ if { ![gdb_gcore_cmd "$core" "save a corefile"] } { return -1 } =20 +set src_line "return 0;" +set src_line_nr [gdb_get_line_number $src_line] + +set run_re \ + "\\\[Inferior $decimal \\\(process $decimal\\\) exited normally\\]" + +if { [info exists USE_TUI] && $USE_TUI =3D=3D 0 } { + clean_restart $testfile + gdb_test "core-file $core" $src_line "load corefile" + gdb_test "run" $run_re "run until the end" + return +} + Term::clean_restart 24 80 $testfile if {![Term::enter_tui]} { unsupported "TUI not supported" @@ -51,8 +64,7 @@ gdb_assert {![string match "No Source Available" $text]} \ "initial source listing" =20 Term::command "core-file $core" -Term::check_contents "load corefile" "21 *return 0.*$gdb_prompt .*" +Term::check_contents "load corefile" "$src_line_nr *$src_line.*$gdb_prompt= .*" =20 Term::command "run" -Term::check_contents "run until the end" \ - "\\\[Inferior $decimal \\\(process $decimal\\\) exited normally\\]" +Term::check_contents "run until the end" $run_re