From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 1B6203858D28; Tue, 17 Jan 2023 16:22:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B6203858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673972563; bh=SKxPbNcGymmioIRCRhR6N+vohby10KcGL3/mgMN77ok=; h=From:To:Subject:Date:From; b=DqrF/xzIOHi/gHiX+vtyVVFYWffR02lyLLru+yabQgO0pM81SQE1HxPiPba5A2mZx NBSKIpOOhpV1ShAurXbFttm76oJADvvm9XtlVb8IYu7sSs7RA/6JjTtnShlQeE7FRw 35vOSdh8el+vlwF6s9L6eMeN0HqjH6WYnGTEoWgM= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: expect SIGSEGV from top GDB spawn id X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: ac37b79cc440e37fc704d425a6e450afb3c7ee89 X-Git-Newrev: 4e2a80ba606fdb48018d06b510ff7873a10e43ae Message-Id: <20230117162243.1B6203858D28@sourceware.org> Date: Tue, 17 Jan 2023 16:22:43 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4e2a80ba606f= db48018d06b510ff7873a10e43ae commit 4e2a80ba606fdb48018d06b510ff7873a10e43ae Author: Simon Marchi Date: Fri Jan 13 20:08:41 2023 -0500 gdb/testsuite: expect SIGSEGV from top GDB spawn id =20 When testing with the native-extended-gdbserver, I get: =20 Thread 1 "xgdb" received signal SIGSEGV, Segmentation fault. 0x00007ffff6d828f2 in GC_find_limit_with_bound () from /usr/lib/x86= _64-linux-gnu/libgc.so.1 (gdb) FAIL: gdb.gdb/selftest.exp: xgdb is at prompt =20 This is because the -re that is supposed to match this SIGSEGV is after `-i $inferior_spawn_id`. On native, the top and bottom GDB are on the same spawn id, so it ends up working. But with a gdbserver board, that's not the case. Move the SIGSEGV -re before the `-i $inferior_spawn_id` line, such that it matches what the top GDB outputs. =20 Do the same fix in gdb.gdb/python-helper.exp. =20 Change-Id: I3291630e218a5a3a6a47805b999ddbc9b968c927 Approved-By: Tom Tromey Diff: --- gdb/testsuite/gdb.gdb/python-helper.exp | 2 +- gdb/testsuite/gdb.gdb/selftest.exp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.gdb/python-helper.exp b/gdb/testsuite/gdb.gd= b/python-helper.exp index c147c6bcbb0..98f03ef456f 100644 --- a/gdb/testsuite/gdb.gdb/python-helper.exp +++ b/gdb/testsuite/gdb.gdb/python-helper.exp @@ -86,13 +86,13 @@ proc test_python_helper {} { # stop is being detected from the inner GDB, hence the use of -i # here. gdb_test_multiple "continue" "start inner gdb" { - -i "$inferior_spawn_id" -re "received signal SIGSEGV.* in GC_.*$outer_prompt_re" { # Some versions of the GC used by Guile cause a SEGV # during stack probing. Ignore this and carry on. send_gdb "continue\n" exp_continue } + -i "$inferior_spawn_id" -re "\r\n$gdb_prompt $" { pass $gdb_test_name } diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/sel= ftest.exp index 177c29fb224..df12602b64b 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp @@ -74,13 +74,13 @@ proc test_with_self { } { "$gdb_prompt $"] set test "xgdb is at prompt" gdb_test_multiple "continue" $test { - -i "$inferior_spawn_id" -re "received signal SIGSEGV.* in GC_.*$gdb_prompt" { # Some versions of the GC used by Guile cause a SEGV # during stack probing. Ignore this and carry on. send_gdb "continue\n" exp_continue } + -i "$inferior_spawn_id" -re "$banner" { pass $test }