From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 6531C3858D28 for ; Tue, 17 Jan 2023 16:33:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6531C3858D28 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com X-ASG-Debug-ID: 1673973219-0c856e762b65b130001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id v79YUE8MyCySCCni (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Tue, 17 Jan 2023 11:33:39 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtp.ebox.ca (Postfix) with ESMTP id 74FB4441B21; Tue, 17 Jan 2023 11:33:39 -0500 (EST) From: Simon Marchi X-Barracuda-RBL-IP: 192.222.180.24 X-Barracuda-Effective-Source-IP: 192-222-180-24.qc.cable.ebox.net[192.222.180.24] X-Barracuda-Apparent-Source-IP: 192.222.180.24 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb/testsuite: fix gdb.gdb/selftest.exp for native-extended-gdbserver Date: Tue, 17 Jan 2023 11:33:39 -0500 X-ASG-Orig-Subj: [PATCH] gdb/testsuite: fix gdb.gdb/selftest.exp for native-extended-gdbserver Message-Id: <20230117163339.869534-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1673973219 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 2367 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.103616 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-3498.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_SOFTFAIL,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Simon Marchi 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: (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 (timeout) The problem is that in this gdb_test_multiple: 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" } } 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. 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. Change-Id: I689bd369a041b48f4dc9858d38bf977d09600da2 --- 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/selftest.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 { } { } } } - + 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 } } base-commit: 4e2a80ba606fdb48018d06b510ff7873a10e43ae -- 2.39.0