From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50402 invoked by alias); 20 Sep 2019 02:16:05 -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 48700 invoked by uid 89); 20 Sep 2019 02:15:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= 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; Fri, 20 Sep 2019 02:15:44 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 47ED21E05A; Thu, 19 Sep 2019 22:15:41 -0400 (EDT) Subject: Re: [PATCH 0/4] Remove some uses of iterate_over_inferiors To: Tom Tromey , gdb-patches@sourceware.org References: <20190919212825.7586-1-tom@tromey.com> From: Simon Marchi Message-ID: <84bd60f3-2a9f-ac45-cf6e-f2823ecca44c@simark.ca> Date: Fri, 20 Sep 2019 02:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <20190919212825.7586-1-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-09/txt/msg00391.txt.bz2 On 2019-09-19 5:28 p.m., Tom Tromey wrote: > This series removes some uses of iterate_over_inferiors in favor of > foreach-style iteration. I find the latter simpler both to debug and > to read. > > There are more instances of iterate_over_inferiors, and other > iterate_over_* functions -- this series is just a starter to see > whether others agree, so let me know what you think. > > Tested on x86-64 Fedora by the buildbot. > > Tom > > Hi Tom, This all looks good to me, I agree with the direction. I was just wondering, why did you choose to use all_inferiors_safe in all these cases, rather than all_inferiors? At first sight, they don't seem to be cases where an inferior can be deleted. Is it maybe that it's simpler to just use the "safe" version and there's no disadvantage to it? Simon