From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id TDfNOCT5lmqtTxsAWB0awg (envelope-from ) for ; Tue, 01 Sep 2026 12:11:16 -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=J/qfv3Lt; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BD3581E166; Tue, 01 Sep 2026 12:11:16 -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 [IPv6:2620:52:6:3111::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 853B21E033 for ; Tue, 01 Sep 2026 12:11:15 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E7004BA798C for ; Tue, 1 Sep 2026 16:11:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E7004BA798C 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=J/qfv3Lt 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 9E1454BA2E17 for ; Tue, 1 Sep 2026 16:10:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E1454BA2E17 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 9E1454BA2E17 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=1788279048; cv=none; b=xVS9pzcy6wkq5nn5kAVK0ugwEAeO9FIUapR24264hx0kvBy+ljf0ze4h1KihOtjQjefugYYSR1RqYMVULGkcg9B8IcidKHKGXQy9AeXFcQ9E6A01trRxk0q1Ai+Tro5lZnxe/o+RJr80+Uvdnp6YqICHuUvJZG8jDCXMR01m8bg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788279048; c=relaxed/simple; bh=Ab2ZtzMyZy/LPxlvffcrKsUyAtIpWvVvxULUWq0q3yM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=UPBeAeSHDVElHl4AQxnsloadahbQLyJMJswWAmidkgF+MksysXlDN8y7jjEMOj95PVJhMVIos027PsCi75t3nlkYXkNNTihuHwCyYndVcjrmEvHkNdhR4NHm4kI5FhDCpKpHFgc+b5FHkr7kZz4CyQsEvy6wBkuXBIthYYYZB+A= 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=J/qfv3Lt DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E1454BA2E17 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788279048; 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=0VnTSzRhkrr05yaOGnvXFpi5p5Bf13d6ZA7GtmHcSBI=; b=J/qfv3LtJFGRwcRH71R6Z2s2awQTSFs7O8ef4xb5nEpk+nF7lyY+vodecTfTubjpXOTFZ0 tCfxmD/zz63V9g9l+xk9VXA0fReZCVoKIe04pCttEJxdlt+gSqW/8UdIAJQNOWwrZE0RT9 ANqFTmhOBSGXRfXVuhOpMM0b13dYyEc= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-271-43-PA5z-NaCVSnTVkECbMw-1; Tue, 01 Sept 2026 12:10:45 -0400 X-MC-Unique: 43-PA5z-NaCVSnTVkECbMw-1 X-Mimecast-MFC-AGG-ID: 43-PA5z-NaCVSnTVkECbMw_1788279045 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-53001b668a6so80652371cf.1 for ; Tue, 01 Sep 2026 09:10:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788279045; x=1788883845; 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=0VnTSzRhkrr05yaOGnvXFpi5p5Bf13d6ZA7GtmHcSBI=; b=nF7nPAeToyXdlokWbqdCvOkh6TmHV4lQlCV8kSLYUcBZGa5MKoih2atVVlbpHKQA75 /C60X2IKgDJVtksMKnm8GQuWlNjDQfkGsoapcfjctoVSnVU0XI6vTa/2+WpsDw1WW3hY 0ms80wKTqETyIXLq5JOnd5z2Zh9pVP5Z95Rc7xkHVomJ5yFJXduvqSe/UuNYwbA9f9zI 8ODYRFR88K1V39SBekCpEmItKYB1c568F5RYIqiN5szRLuttbxv1ciRniO8HerlsENEc R9TLeTmwKoEKyn1+IjDoFUdS3TvCB9GmTR51AxDnFAhhtUaCwZjjoAkVDVbZxjB3kVuO JTvw== X-Forwarded-Encrypted: i=1; AHgh+RowVV/JR6M98s4mQx0jrG29bQkmt5o600PxoWX5dFbdQ9q/rxgdx8MRB8D8o4zuR8yrCngkCkNC0lY+/Q==@sourceware.org X-Gm-Message-State: AFuF++nGw1YuhL5HUv52/a54CH1z5ffqG0AFeWhT0rqHspJ3nbfuQR4k GP5G5mSMtyQXKMADrcNXOSqLXFWyJ9cFMz8KjcreyusNeDp2Mt38HRHOzVMNBGz+xTm6oOmmoiI yAxWVkG2J8s0i7ofO3wtwjzylY/ULZB/kWMc/y4KTAzIQQJFOtKMrqB0RzavqlR0= X-Gm-Gg: AR+sD119GclQ8gqB+Pgzj10kHbpgr9mI7mFXmCIOHUfzxeV5N4Dosox66beZaqiDmX8 oRji+jae0dnnbDLIAl1QY4GUdfUo9YxAQCc30Py6pL6es+0L0znF4oTrlWS+vcxxcVOeqQqxEQY bg3N5y6iX5xYvDwlWc97+csPY5w3tPe5Vak3TFJBlJqQ3ijof7pAzM7cAxMvsBG3FzFQY8H7Jdw BpWwFa5vSv/NtdawGlrgriOuYc1IUrJzCVsVj1NiTUxBD+aD1R+BLpvN+VeOWqOiaK0g+yqqmTu 57RRdbbA5bdVPFLnIqXc5NkFmDcALw1oPQSSfCfPVDH1omYMW0xdDhWZZzpGpOW0sIO7b5U0HbS 6PJ8o5Q== X-Received: by 2002:a05:622a:13c9:b0:52d:6096:b398 with SMTP id d75a77b69052e-52fb93d17d9mr361234581cf.10.1788279044688; Tue, 01 Sep 2026 09:10:44 -0700 (PDT) X-Received: by 2002:a05:622a:13c9:b0:52d:6096:b398 with SMTP id d75a77b69052e-52fb93d17d9mr361233561cf.10.1788279044026; Tue, 01 Sep 2026 09:10:44 -0700 (PDT) Received: from [150.1.200.157] ([172.56.108.54]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-90d98a9b324sm93761806d6.20.2026.09.01.09.10.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Sep 2026 09:10:43 -0700 (PDT) Message-ID: <9da9e1c1-bf93-4bd0-9886-cc208962aca0@redhat.com> Date: Tue, 1 Sep 2026 09:10:41 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 11/11] [gdb/testsuite] Refactor exception handling in with_stub_devices To: Tom de Vries , gdb-patches@sourceware.org References: <20260824135855.1195963-1-tdevries@suse.de> <20260824135855.1195963-12-tdevries@suse.de> From: Keith Seitz In-Reply-To: <20260824135855.1195963-12-tdevries@suse.de> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: fUl4i9eahTG8v2vAiTy7fki4g_CS2dG-a5WC2ZCD06I_1788279045 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: > Use with_override and try/finally to simplify with_stub_devices. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34552 > --- > gdb/testsuite/gdb.rocm/hcc-amdgpu-targets.exp | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/gdb/testsuite/gdb.rocm/hcc-amdgpu-targets.exp b/gdb/testsuite/gdb.rocm/hcc-amdgpu-targets.exp > index 8f04cca7981..7f90a112138 100644 > --- a/gdb/testsuite/gdb.rocm/hcc-amdgpu-targets.exp > +++ b/gdb/testsuite/gdb.rocm/hcc-amdgpu-targets.exp > @@ -24,13 +24,16 @@ load_lib rocm.exp > # Run BODY with find_amdgpu_devices stubbed to return DEVICES, then > # restore the original proc. > proc with_stub_devices {devices body} { > - rename find_amdgpu_devices __saved_find_amdgpu_devices > # tclint-disable-next-line command-args > - proc find_amdgpu_devices {} [list return $devices] > - set code [catch {uplevel 1 $body} result] > - rename find_amdgpu_devices {} > - rename __saved_find_amdgpu_devices find_amdgpu_devices > - return -code $code $result > + proc with_stub_devices_find_amdgpu_devices {} [list return $devices] > + try { > + # tclint-disable-next-line command-args > + with_override \ > + find_amdgpu_devices with_stub_devices_find_amdgpu_devices \ > + $body > + } finally { > + rename with_stub_devices_find_amdgpu_devices {} > + } IIUC, this try block using with_override is effectively evaluating "$body" in this context (with_stub_devices). Previously the uplevel would cause this to run in the caller. Is this missing a call to transparent_uplevel? Keith