From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17427 invoked by alias); 10 Jul 2018 01:45:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 17334 invoked by uid 89); 10 Jul 2018 01:45:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=popped X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Jul 2018 01:45:43 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8DEE91E08D; Mon, 9 Jul 2018 21:45:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1531187140; bh=U2FLfaw5PGIW6JrQAT5ZfbC1Rja3OgL/NCwdavLggo4=; h=Subject:From:To:References:Date:In-Reply-To:From; b=BYdgbdeamjCXHraTUbC8LlOmbW7f2VkOGq1KS3XT60YBcb/BY0KiI8QvFs6eRGL1D ryCBKDgz3LIFtW++iLD3hFdHnbnHP17Rkvx4AcRaMagpfhyLDUE0cnwDRZC3w0CC5s B23t4Uxy2ZA9LsxxJTMxcLS0RCJ/F7xN83yIe5c4= Subject: Re: [RFA 21/42] Move the context stack to buildsym_compunit From: Simon Marchi To: Tom Tromey , GDB patches References: <20180523045851.11660-1-tom@tromey.com> <20180523045851.11660-22-tom@tromey.com> <93a9597f-e7ff-e8ff-e873-9cee5b84d7cc@simark.ca> Message-ID: <192f3f5e-5272-e090-71be-5d6dc4bfb1ce@simark.ca> Date: Tue, 10 Jul 2018 01:45:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <93a9597f-e7ff-e8ff-e873-9cee5b84d7cc@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-07/txt/msg00236.txt.bz2 On 2018-07-08 01:49 PM, Simon Marchi wrote: > On 2018-05-23 12:58 AM, Tom Tromey wrote: >> This moves the context stack globals to be members of >> buildsym_compunit, changing the type to a std::vector in the process. >> >> Note that the context stack works in a somewhat odd way, where callers >> can pop the stack and expect the returned pointer to remain valid >> until the next pop. In the new code we handle this by having a >> "popped context" object that remains valid in this way. > > Would it work to make pop_context return the context_stack object by value > instead? > >> @@ -270,6 +261,19 @@ extern void set_local_using_directives (struct using_direct *new_local); >> >> extern struct using_direct **get_global_using_directives (); >> >> +/* Non-zero if the context stack is empty. */ >> + >> +extern bool outermost_context_p (); > > "True" instead of "Non-zero". > > Simon Damn, failed to reply all again. Simon