From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1551) id 292173858D28; Mon, 18 Jul 2022 16:31:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 292173858D28 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pedro Alves To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Put gdb.base/bt-on-fatal-signal.exp GDB cores in output dir X-Act-Checkin: binutils-gdb X-Git-Author: Pedro Alves X-Git-Refname: refs/heads/master X-Git-Oldrev: 6a40c6e4374a660eab5cdc2f8a777ccbd7a81951 X-Git-Newrev: 23948f56021f46bb2bdee7afad074aafe8329230 Message-Id: <20220718163113.292173858D28@sourceware.org> Date: Mon, 18 Jul 2022 16:31:13 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2022 16:31:13 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D23948f56021f= 46bb2bdee7afad074aafe8329230 commit 23948f56021f46bb2bdee7afad074aafe8329230 Author: Pedro Alves Date: Wed Jul 13 16:45:21 2022 +0100 Put gdb.base/bt-on-fatal-signal.exp GDB cores in output dir =20 I noticed that gdb.base/bt-on-fatal-signal.exp was contributing four core files to the count of unexpected core files: =20 $ make check TESTS=3D"gdb.base/bt-on-fatal-signal.exp" =20 =3D=3D=3D gdb Summary =3D=3D=3D =20 # of unexpected core files 4 # of expected passes 21 =20 These are GDB core dumps. They are expected, however, because the whole point of the testcase is to crash GDB with a signal. =20 Make GDB change its current directory to the output dir just before crashing, so that the core files end up there. The result is now: =20 =3D=3D=3D gdb Summary =3D=3D=3D =20 # of expected passes 25 =20 and: =20 $ find . -name "core.*" ./testsuite/outputs/gdb.base/bt-on-fatal-signal/core.gdb.1676506.nelso= n.1657727692 ./testsuite/outputs/gdb.base/bt-on-fatal-signal/core.gdb.1672585.nelso= n.1657727671 ./testsuite/outputs/gdb.base/bt-on-fatal-signal/core.gdb.1674833.nelso= n.1657727683 ./testsuite/outputs/gdb.base/bt-on-fatal-signal/core.gdb.1673709.nelso= n.1657727676 =20 (Note the test is skipped at the top if on a remote host.) =20 Change-Id: I79e4fb2e91330279c7a509930b1952194a72e85a Diff: --- gdb/testsuite/gdb.base/bt-on-fatal-signal.exp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp b/gdb/testsuite/= gdb.base/bt-on-fatal-signal.exp index 8adf3c4fa45..8f9d857106d 100644 --- a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp +++ b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp @@ -80,6 +80,11 @@ foreach test_data {{SEGV "Segmentation fault"} \ set saw_bt_end false set internal_error_msg_count 0 =20 + # Get the GDB core into the output directory, so that it + # doesn't count as unexpected core in gdb.sum. + gdb_test "cd [file dirname $binfile]" "Working directory .*" \ + "cd to test directory" + # Send the fatal signal to GDB. remote_exec host "kill -${sig} ${testpid}"