From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +ePGB7sz5mkIqiwAWB0awg (envelope-from ) for ; Mon, 20 Apr 2026 10:10:03 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=anogvr5E; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 151881E0BA; Mon, 20 Apr 2026 10:10:03 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED 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 859E81E067 for ; Mon, 20 Apr 2026 10:10:02 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 221564D108C8 for ; Mon, 20 Apr 2026 14:10:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 221564D108C8 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=anogvr5E Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by sourceware.org (Postfix) with ESMTPS id 46C164C91748 for ; Mon, 20 Apr 2026 14:09:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 46C164C91748 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 46C164C91748 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::2c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776694177; cv=none; b=K/nPK0OtDDcHDwL4qXEgDblAz2ceKrz5MOUbGP2To4a7ESQp86ABf3OjeW1Ck2d2LQSLXfG88owvWB9xPh14mNhbLHsWBxx+lSl/E60KjL1yoijlY/WQlFOVqC9oEfcduX4Q/so6lXHYuYP0XpwHaGJJdLloqEvUKfHAhQ0+sZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776694177; c=relaxed/simple; bh=sLd45McPWekZH582UTyeSpA1a5rKlZPk/SU+LpEdxaA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uKwf60L5XYZsN3b/0TQXEjBUXj1jFLE2RNic3dzZv9z1Fy4R8Cy3ixA4jE2Wj+GwP56JJly3vG2C4KzccrmIFHcqKdpseAAYN2OW0gSnrFeqCBIOwaCQ4szjGs7HdZiz9uD5OrWA5FV3nfnPYxEahCCS1L52FXb+947NrXM9XT4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46C164C91748 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-40ef10ec84cso2491366fac.2 for ; Mon, 20 Apr 2026 07:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1776694176; x=1777298976; darn=sourceware.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=50JwNwvsU8JNxWlfiOLNmv7TkoVM46ccWGTvZadR9g8=; b=anogvr5EY+GNCg4Jugb3pzhcZUcyNz2MNrgR97aUU3mJ989hVXC9dfH3Zgw9WwIP5e 8ghvxPzDQPe1Sc+06WItHmIxY7J+UWDTnbgaVA7ET+kR/k510LgLcuFAOgOkwCihPEtz hvAIxz5ZnORNoo5QfHxKPANZg/dOgO11kEeoqd1S6MgJ0Wqr82Uz7fjGAGmNNO8D46M/ CoEI8y2pMHaxK4vPwRFuBh/E2kYGUYkIxctA1EDoeHaEfiyNsxdT3DEF3mRB6IVSiD1o JL9uNDzGUzQ5KbzSrjRNjTbZy/09GbWppCH2f153oVtj1md92cV38hWd8HvDEcpGsxed BXHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776694176; x=1777298976; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=50JwNwvsU8JNxWlfiOLNmv7TkoVM46ccWGTvZadR9g8=; b=sav0Mg+X0W1AsN/ybIBh8SezvE5NNDcDDtJfvjGEDe3loz1D269LXZVf8a/RbHgP14 bCrSX4DBwWlUA+Qox7VbbOBrwaiE/r3UO0QvWh1RnVJhsnd3TwL9ZR0akU+KNsNPapB6 VWae8ObG/mqN50zO2fXyIGtPpo6zOYoJN2hAyAOaYuf3g1vJ53T5/AJbTeohZedq96o+ ai3WXOgxLzlmbXZyIGt1KFi8vIzFcRZ19vzH7KcLVQFtldwz+vC4aP8c2/8PbroXdrcQ tGz7OzUhe2thCl41JwYLU9eSNJeio/g0YEyft+GvBEfQfEOX7lCyWVwWu3rp20AsnNof PRjw== X-Forwarded-Encrypted: i=1; AFNElJ82wnkPXDB2IJCd3MOlBLCYXANaW4prvGeelBmyS25PHweBZfpmWYFHvhZGppqa1d4A6zM3AjYe8ZDgnQ==@sourceware.org X-Gm-Message-State: AOJu0YzbxS9IwqFotRzHy9U6SLvBiWOdmoig5ewUDjeoPjZPke8qWtEa eDdDtFOnQPlLjD0C0jkWnwfj5zAoFlAj0Ja5D/h/gdUtvg8aV26jarrR9RlwgLPcKw== X-Gm-Gg: AeBDiev7wcKbIS1af/cpsK66elJ4v8+IOzbHETBwaVjUzWFyTmtcfyCHlHVIcTgnDRd x2gR6MQpiIwF+YwafYLKgjWtQfYKZQz9QL0w4VWQzwz5so7xMdZA5XJqeL7CAMHwnRGy3Ll42zu t+AoSMOkpFIgujwPa1CCtBSi/wOf18LC2zREyCIbpYI7+IsRBEdMf5Ya3agetK+8WpwzNBpADxy 0Nuqj3uk9AL3muFGUgYFPU+sr3NeU2z8rv/tlNwoBt7cYyDtWCKfLeSHLiwqqDLMo3G+bwzdxd/ +cHPW/VLjdfYMskwUc9AFInc1iinsEojTa86Qo30xbR8y+9fkEySY6dHWVLitwD4KLOSk9XQl5w x5S48DObnJ9+pXFCS0bO5gxTekv44t7dEiLcNaBR0wN64DLv9hs8G6QW0vNnq1bt0IU6VN081XT P7l7Y0f2gEnqBtFZzboZk93m2Mivv1AifJ2aHt8oa04DfONo8DUCEeNdbs53pukS0J X-Received: by 2002:a05:6871:8914:b0:428:2733:39e7 with SMTP id 586e51a60fabf-42abf22401amr8223778fac.2.1776694175975; Mon, 20 Apr 2026 07:09:35 -0700 (PDT) Received: from bapiya (75-166-225-82.hlrn.qwest.net. [75.166.225.82]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-42b9ac6f2a3sm9499619fac.16.2026.04.20.07.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 07:09:35 -0700 (PDT) From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 4/6] Change pop_context to return a block In-Reply-To: (Simon Marchi's message of "Fri, 17 Apr 2026 16:11:21 -0400") References: <20260417-list-in-scope-v1-0-0deb050fc03d@adacore.com> <20260417-list-in-scope-v1-4-0deb050fc03d@adacore.com> X-Attribution: Tom Date: Mon, 20 Apr 2026 08:09:34 -0600 Message-ID: <87a4uxsoyp.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain 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 >>>>> "Simon" == Simon Marchi writes: Simon> My understanding is that the "current" locals and local_using_directives Simon> vectors are not held in m_context_stack, they are held in these Simon> m_local_symbols and m_local_using_directives fields. An entry in Simon> m_context_stack is a saved context, to be restored later. I wonder if Simon> it would simplify the code if we removed m_local_symbols and Simon> m_local_using_directives, and said that the topmost m_context_stack Simon> entry holds the current locals and local_using_directives. That would Simon> mean pushing an initial context_stack entry for the global scope, I Simon> guess? Simon> We wouldn't need moving in and out of m_local_symbols and Simon> m_local_using_directives anymore. I don't think it would simplify that Simon> much in terms of number of lines, but it might make the code a bit Simon> easier to follow. Just something to explore, I think this patch is Simon> good. Yeah, this might be a good future change, considering that right now the stack is incoherent: the current function is stored in the stack entry but other things are not. I had considered this but I didn't really feel like making the change and then debugging the inevitable bug I'd introduce. I.e., I wanted to keep this series relatively straightforward. Tom