From patchwork Tue Jan 17 16:33:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 63278 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E05E43858C2B for ; Tue, 17 Jan 2023 16:34:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E05E43858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673973246; bh=FPth15BiBm34i4PL7rz7UoYLj1XmxW+PnU+Y4TUxDB8=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=D75KjFZL1fgHebp4ARK7bXclYU/+ydfLzdBy7K3K0echRi+qkRX3dW6xCmbNBT/JJ 1CgbVgrZuw32mIQPXvDjkwbNw9YqCTGqjP4gh1caSkG0RGI66nYkBRDXqjcmpS+qMW 2BTI9ndD4Dd5YSzUT25MCuFE9W+D2Y5ZG3+6IAOA= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 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) 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 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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(-) base-commit: 4e2a80ba606fdb48018d06b510ff7873a10e43ae 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 } }