From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 8F6513858414; Fri, 10 Feb 2023 18:58:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F6513858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676055507; bh=AwPNuvpOituYRWcdpl80Q/L23MaS8KV9tw2NjZR0M0k=; h=From:To:Subject:Date:From; b=iIKWcUjfKKMYEqG/lP2xPL58PwJnUDpg+fcinlSb4w9w0/dYBljjizhj7RTF0MURa 6NECZIIftdrY6fTCXK3AQmXx4UkD0oARyiDTHT6RY+l0KFA8gFiwqIThVvAhS8ErjE z/wzDGBKtW/aCYX820nlsz73F7U0IZId3bqGzRak= 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: fix gdb.gdb/selftest.exp for native-extended-gdbserver X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 25eb2931f6f19d5ef48d240774bab488f6d52bf1 X-Git-Newrev: 71bb560755cad815f5159170822cb66df71f916f Message-Id: <20230210185827.8F6513858414@sourceware.org> Date: Fri, 10 Feb 2023 18:58:27 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D71bb560755ca= d815f5159170822cb66df71f916f commit 71bb560755cad815f5159170822cb66df71f916f Author: Simon Marchi Date: Tue Jan 17 11:33:39 2023 -0500 gdb/testsuite: fix gdb.gdb/selftest.exp for native-extended-gdbserver =20 Following commit 4e2a80ba606 ("gdb/testsuite: expect SIGSEGV from top GDB spawn id"), the next failure I get in gdb.gdb/selftest.exp, using the native-extended-gdbserver, is: =20 (gdb) PASS: gdb.gdb/selftest.exp: send ^C to child process signal SIGINT Continuing with signal SIGINT. FAIL: gdb.gdb/selftest.exp: send SIGINT signal to child process (ti= meout) =20 The problem is that in this gdb_test_multiple: =20 set description "send SIGINT signal to child process" gdb_test_multiple "signal SIGINT" "$description" { -re "^signal SIGINT\r\nContinuing with signal SIGINT.\r\nQuit\r= \n.* $" { pass "$description" } } =20 The "Continuing with signal SIGINT" portion is printed by the top GDB, while the Quit portion is printed by the bottom GDB. As the gdb_test_multiple is written, it expects both the the top GDB's spawn id. =20 Fix this by splitting the gdb_test_multiple in two. The first one expects the "Continuing with signal SIGINT" from the top GDB. The second one expect "Quit" and the "(xgdb)" prompt from $inferior_spawn_id. When debugging natively, this spawn id will be the same as the top GDB's spawn id, but it's different when debugging with GDBserver. =20 Change-Id: I689bd369a041b48f4dc9858d38bf977d09600da2 Diff: --- gdb/testsuite/gdb.gdb/selftest.exp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/sel= ftest.exp index df12602b64b..ac3f3fc2f6a 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp @@ -114,11 +114,18 @@ proc test_with_self { } { } } } - =20 + set description "send SIGINT signal to child process" - gdb_test_multiple "signal SIGINT" "$description" { - -re "^signal SIGINT\r\nContinuing with signal SIGINT.\r\nQuit\r\n.* $" { - pass "$description" + gdb_test_multiple "signal SIGINT" "$description, top GDB message" { + -re "^signal SIGINT\r\nContinuing with signal SIGINT.\r\n" { + pass $gdb_test_name + } + } + + gdb_test_multiple "" "$description, bottom GDB message" { + -i $inferior_spawn_id + -re "Quit\r\n\\(xgdb\\) $" { + pass $gdb_test_name } }