From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59811 invoked by alias); 9 Oct 2017 15:46:10 -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 59802 invoked by uid 89); 9 Oct 2017 15:46:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=tip X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Oct 2017 15:46:08 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v99FjxCH015638 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 9 Oct 2017 11:46:04 -0400 Received: from [10.0.0.11] (cable-192.222.251.162.electronicbox.net [192.222.251.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0D2BD1E055; Mon, 9 Oct 2017 11:45:59 -0400 (EDT) Subject: Re: [PATCH v2] gdbserver: Use std::list for all_dlls To: Pedro Alves , gdb-patches@sourceware.org References: <20171009151221.7538-1-simon.marchi@polymtl.ca> <4ca822bf-81c1-ff9e-c6a8-99ef44ba7d61@redhat.com> From: Simon Marchi Message-ID: Date: Mon, 09 Oct 2017 15:46:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <4ca822bf-81c1-ff9e-c6a8-99ef44ba7d61@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 9 Oct 2017 15:45:59 +0000 X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00215.txt.bz2 On 2017-10-09 11:33 AM, Pedro Alves wrote: > On 10/09/2017 04:12 PM, Simon Marchi wrote: >> As a small step towards removing inferior_list/inferior_list_entry, this >> patch replaces the usage of inferior_list for the list of dlls by an >> std::list. The dll_info type now uses an std::string for name and has a >> simple constructor. >> >> I am able to build gdbserver with mingw on Linux, but I am not able to >> test this on a Windows machine (the only platform that uses this code). >> > > Thanks for the update. This version is fine with me. > >> >> @@ -76,16 +40,20 @@ loaded_dll (const char *name, CORE_ADDR base_addr) >> void >> unloaded_dll (const char *name, CORE_ADDR base_addr) >> { >> - struct dll_info *dll; >> - struct dll_info key_dll; >> + auto pred = [&] (const dll_info &dll) { > > FWIW, I've been formatting lambdas like this: > > auto pred = [&] (const dll_info &dll) > { > if (base_addr != UNSPECIFIED_CORE_ADDR > > for_each (..., [&] (const dll_info &dll) > { > if (base_addr != UNSPECIFIED_CORE_ADDR > > The latter models on: > > if (foo) > { > if (base_addr != UNSPECIFIED_CORE_ADDR > > The former I think from the latter, and because that's > what emacs+tab wants. Ok, thanks for the tip. I'll change that in my local branch. Simon