From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QYhiDMj5lmqwURsAWB0awg (envelope-from ) for ; Tue, 01 Sep 2026 12:14:00 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=d2yKu6RF; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 2F1971E033; Tue, 01 Sep 2026 12:14:00 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 10B5C1E033 for ; Tue, 01 Sep 2026 12:13:59 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F80E4BA23ED for ; Tue, 1 Sep 2026 16:13:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F80E4BA23ED Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=d2yKu6RF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 006D24BA2E2C for ; Tue, 1 Sep 2026 16:13:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 006D24BA2E2C Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 006D24BA2E2C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788279214; cv=none; b=pXAR0ZfJGcgswcreZAUEgmJ+xfXYMIiy805GUZfXQ2u6LRGepQQz6DeSg3jBdA4cW7lyJ35myLB8rzcY0E99aFSk1p3MSn9a2nl9KFobm2uHKx14M8APUs62ApfKmjvmM03U1FvDR4e130z76x84+3WWbc55VNW82AViE5kM2l0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788279214; c=relaxed/simple; bh=AJLSZxSkVTgjOaOsr0aSqOefYYO0fjDBZtcDv/aYeb8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=rNPHBcMgVBcWkNVJgr3FpqKB6oXNShUJUnxGV/4x+TovaK25lKuhaIadTKucnozxv5sg3TWoPMzRbg34HUsBJj3wPKrUDRqS1EiRWq9zZvzoJ7BYu4ij7Q9ih7D5Zw0EeJhVOxBwCdbTmPMUjnPOgKrDcrlO3oWln9AyzleQfY0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=d2yKu6RF DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 006D24BA2E2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788279213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E25WjuFazuofoDGG4KbFJANhGhyHZTu2eOX/7WogRGg=; b=d2yKu6RFptakhgX2YvDI1lr2q0M+0KuZ0LTIImOBD7hSJooaxko5y98oeBLwnKlFhvqVan 4QnpLdNrtqGfNKOYNWsM4IIxb0OjJ//yslmTVOV+Il7uXxkkaV/DYF271LHqFATtJpEhAo xafv9spgF2aQWV12hmkCrgkh/cJ/2Ec= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-48N3KMYkO4iLZYPOiJza6w-1; Tue, 01 Sept 2026 12:13:32 -0400 X-MC-Unique: 48N3KMYkO4iLZYPOiJza6w-1 X-Mimecast-MFC-AGG-ID: 48N3KMYkO4iLZYPOiJza6w_1788279212 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-53013dc2330so62539461cf.0 for ; Tue, 01 Sep 2026 09:13:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788279212; x=1788884012; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=E25WjuFazuofoDGG4KbFJANhGhyHZTu2eOX/7WogRGg=; b=dEaF2LatXqqpZXjAUcRmwCQnhQl5UJn5iq7VOvon+PJcdEWtGVrswL26k7wiLzfQKC bZWJJabmpvlir/OCZogkXmgjjup9ymmjq5IMCPvb7avnhHvBkpeeu0GAOE8WaDiqB3TG 4tVfkg71XC7FIxSG3z5I2d36zPRUgkjz1h8Ghzb4tZDrc45a2598mXFzF5zKrYKijqXU hXFk9i33HH755J0xGWN0eIq+2K5gn9WO+pg49PvtRpt88M9mcPQkbZFAHfjWZtVpIpiT PUMjH2p39OAt7vy/i8CrW/X72SXza27eRZ4P2wkZyGBGg1Xq/6cc3Knl7UyOFR8d7Wui 4BfQ== X-Forwarded-Encrypted: i=1; AHgh+RrK1+VDl7WbjBwqpX5jmKUGk9FRSo70R9dh/b56Hs4rCpP41pj2qRNY+CxGkr8Ejp14ihLnJ2opcWvFXg==@sourceware.org X-Gm-Message-State: AFuF++m/7t+hB4k84VupE0VWBbXEJqW0qVrhpX34pex5JawlcOdwJxrF guv3Q+jMV15IkFuBL1MLFN/ws7X3s+k1K84pdurtPpRJsjiixmlqEKlevB/fAYIxQhYZ/l8wlK8 B6KgUydjA9xVQuxxo/0x0UpakkxEP6poaa+jEvOQBfFSk91zwEjyScdxdeAMjfpmdrQxZNZo= X-Gm-Gg: AR+sD10EgsFueShCTbS/pTsD2ldUlu+WD4mkUgKCdUzdEkWf0XfKJwsAX3Mo9oXbKKi 1voBsRaVYafcZdoLqs8iVlfmEuZvMm1NDVDvSsxSL3wbkmJp17LjwN76/mJIMcIvoyN9J/geL4Z BFlo2kS8YcRyxJNEKOeDHqm+eT304LB4c3GyxFGOzr1fqsk3O80ttqyzpnTfeSkhE0UXimkVfq3 D9D5aNWlVFGeDTUf+FiqT8iCEWJs8+jDv6Sgxe/TH7vypat63pb03Cv/0fV+NGkcQL6a5tiG0x2 k+Hh6SwuSx1FeIFVY9ZC/3XffhKu+rrTPtALt5YB+qL3JJ+HyQBGOEB81CaHfF0kDySC30Z/kIQ H76+HJQ== X-Received: by 2002:a05:622a:8c7:b0:51b:ec6c:766c with SMTP id d75a77b69052e-52fb93edd40mr466659611cf.12.1788279211634; Tue, 01 Sep 2026 09:13:31 -0700 (PDT) X-Received: by 2002:a05:622a:8c7:b0:51b:ec6c:766c with SMTP id d75a77b69052e-52fb93edd40mr466657991cf.12.1788279210796; Tue, 01 Sep 2026 09:13:30 -0700 (PDT) Received: from [150.1.200.157] ([172.56.108.54]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-53032ff4e90sm314871cf.2.2026.09.01.09.13.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Sep 2026 09:13:30 -0700 (PDT) Message-ID: <4f957a9a-d555-44c1-ad6b-93dc0cd7b013@redhat.com> Date: Tue, 1 Sep 2026 09:13:29 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 08/11] [gdb/testsuite] Refactor exception handling in gdb_test_multiple To: Tom de Vries , gdb-patches@sourceware.org References: <20260824135855.1195963-1-tdevries@suse.de> <20260824135855.1195963-9-tdevries@suse.de> From: Keith Seitz In-Reply-To: <20260824135855.1195963-9-tdevries@suse.de> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ufxnsK3FJa-PwyQFZM81WrWZnH10ar0GXSQIaV_rTa8_1788279212 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Hi, On 8/24/26 6:58 AM, Tom de Vries wrote: > Simplify gdb_test_multiple using return -options and try/finally. > > In the process, we also try to fix PR34553. > > I've added a test to verify this, but it'll be only useful after remote_expect > gets fixed [1]. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34552 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34553 > > [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=81691 > --- > gdb/testsuite/gdb.testsuite/gdb-test.exp | 51 ++++++++++++++++++++++++ > gdb/testsuite/lib/gdb.exp | 37 +++++++++-------- > 2 files changed, 69 insertions(+), 19 deletions(-) > > diff --git a/gdb/testsuite/gdb.testsuite/gdb-test.exp b/gdb/testsuite/gdb.testsuite/gdb-test.exp > index dab65f21bdb..231f0755f58 100644 > --- a/gdb/testsuite/gdb.testsuite/gdb-test.exp > +++ b/gdb/testsuite/gdb.testsuite/gdb-test.exp > @@ -49,6 +49,57 @@ with_test_prefix "cmd with trailing control code" { > } > } > > +foreach_with_prefix variant {0 1 2} { > + proc level_2_inner {} { > + if {$::variant == 0} { > + return -level 2 "return_level_2" > + } elseif {$::variant == 1} { > + send_gdb "print 1\n" > + set prompt_re [string_to_regexp "(gdb) "] > + remote_expect host 10 { > + -re " = 1\r\n$prompt_re$" { > + return -level 2 "return_level_2" > + } > + } > + } else { > + gdb_test_multiple "print 1" "" { > + -re -wrap " = 1" { > + return -level 2 "return_level_2" > + } > + } > + } > + return "inner" > + } > + > + proc level_2_outer {} { > + level_2_inner > + return "outer" > + } > + > + try { > + set res "initial" > + set res [level_2_outer] > + } finally { > + if {$variant == 0} { > + # trivial case. > + gdb_assert {$res == "return_level_2"} > + } elseif {$variant == 1} { > + # Remove_expect case. Typo? Should this be "remote_expect" case? Keith > + if {$res == "outer"} { > + # Dejagnu bug. > + # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=81691 > + setup_xfail *-*-* > + } > + gdb_assert {$res == "return_level_2"} > + set variant1_res $res > + } else { > + # Gdb_test_multiple case. This should work if the remote_expect > + # case works. > + gdb_assert {$res == $variant1_res} > + } > + } > +} > + > # Change the prompt. > set prompt "(GDB) " > set prompt_re "\\(GDB\\) $"