From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4583 invoked by alias); 14 Sep 2017 14:14:09 -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 4563 invoked by uid 89); 14 Sep 2017 14:14:08 -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; Thu, 14 Sep 2017 14:14:07 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3BC3BC047B70; Thu, 14 Sep 2017 14:14:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3BC3BC047B70 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 A68A66CDC8; Thu, 14 Sep 2017 14:14:03 +0000 (UTC) Subject: Re: [PATCH] Make dwarf_expr_piece::pieces an std::vector To: Simon Marchi References: <1505376948-22860-1-git-send-email-simon.marchi@ericsson.com> <83688181-eb4a-b2d6-f614-b011c6220cd3@redhat.com> <20733c26c93b710b8554c149c02d3fb3@polymtl.ca> Cc: Simon Marchi , gdb-patches@sourceware.org, arnez@linux.vnet.ibm.com From: Pedro Alves Message-ID: Date: Thu, 14 Sep 2017 14:14: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: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00376.txt.bz2 On 09/14/2017 02:57 PM, Simon Marchi wrote: > I initially left it as a pointer out of laziness, but I've changed it to > a reference now. I am pushing the patch with this and the const rvalue > reference fixed. > > I tried to add some constructors, but I didn't know how to design it > nicely to support different types of value locations. Ah, yes, now that I look better, I see how the function is calling private context functions. > Maybe the best > would be to add some factory functions that build various kinds of > pieces, and make the constructor private. Something like: > > struct dwarf_expr_piece > { > static dwarf_expr_piece make_memory_piece (CORE_ADDR addr, bool > in_stack_memory) > static dwarf_expr_piece make_register_piece (int regno); > > private: > dwarf_expr_piece (); > }; > > I'll try that for a follow-up patch. That might work. I'm fine with the status quo too, btw. Thanks, Pedro Alves