From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4313 invoked by alias); 9 Oct 2017 15:33:54 -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 4297 invoked by uid 89); 9 Oct 2017 15:33:53 -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 autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Oct 2017 15:33:52 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D389C04AC6B; Mon, 9 Oct 2017 15:33:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3D389C04AC6B Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93A086155F; Mon, 9 Oct 2017 15:33:50 +0000 (UTC) Subject: Re: [PATCH v2] gdbserver: Use std::list for all_dlls To: Simon Marchi , gdb-patches@sourceware.org References: <20171009151221.7538-1-simon.marchi@polymtl.ca> From: Pedro Alves Message-ID: <4ca822bf-81c1-ff9e-c6a8-99ef44ba7d61@redhat.com> Date: Mon, 09 Oct 2017 15:33:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20171009151221.7538-1-simon.marchi@polymtl.ca> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-10/txt/msg00214.txt.bz2 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. Thanks, Pedro Alves