From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id P7kiCYK6AWEvKAAAWB0awg (envelope-from ) for ; Wed, 28 Jul 2021 16:13:54 -0400 Received: by simark.ca (Postfix, from userid 112) id 0F4391EDFB; Wed, 28 Jul 2021 16:13:54 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3F73B1E813 for ; Wed, 28 Jul 2021 16:13:53 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E4AFF388A80D for ; Wed, 28 Jul 2021 20:13:51 +0000 (GMT) Received: from gateway30.websitewelcome.com (gateway30.websitewelcome.com [192.185.194.16]) by sourceware.org (Postfix) with ESMTPS id 59429385C405 for ; Wed, 28 Jul 2021 20:13:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 59429385C405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tromey.com Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 96A893C3CE for ; Wed, 28 Jul 2021 15:13:22 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 8pvemNs0ajSwz8pvem34WD; Wed, 28 Jul 2021 15:13:22 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=kGr1j9WG+X7s1yIVYY2HxDN4Zvih8EQTytUl3wqDGyI=; b=kS2wtBc27FbjmCDy/bkYrOI9vY Gq27zMNVFiduXm8JtFBpBpO1XhJwahKKQ0w0GH6KQUvgW3ZirBCPTpUajyKWx2iYCn8vJ99lxYIo6 MLZAUno3IQspb6J3b3DjKqOBU; Received: from 97-122-74-117.hlrn.qwest.net ([97.122.74.117]:35950 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m8pve-002yN7-92; Wed, 28 Jul 2021 14:13:22 -0600 From: Tom Tromey To: Lancelot SIX via Gdb-patches Subject: Re: [PATCH 15/16] gdb: make cmd_list_element var an optional union References: <20210714045520.1623120-1-simon.marchi@polymtl.ca> <20210714045520.1623120-16-simon.marchi@polymtl.ca> <20210714120851.3pfew5pgcdp6ezn6@ubuntu.lan> <20210714171238.vzccwpurh2izbkps@ubuntu.lan> <20210714232112.wsn7pits6uuz3nf5@ubuntu.lan> <20210720230335.dcpfxbol2uwjre3b@Plymouth> X-Attribution: Tom Date: Wed, 28 Jul 2021 14:13:21 -0600 In-Reply-To: <20210720230335.dcpfxbol2uwjre3b@Plymouth> (Lancelot SIX via Gdb-patches's message of "Wed, 21 Jul 2021 00:03:35 +0100") Message-ID: <87sfzyci3i.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.74.117 X-Source-L: No X-Exim-ID: 1m8pve-002yN7-92 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-74-117.hlrn.qwest.net (murgatroyd) [97.122.74.117]:35950 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lancelot SIX Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" >>>>> "Lancelot" == Lancelot SIX via Gdb-patches writes: Lancelot> This patch proposes to add an abstraction around the pair of the Lancelot> var_type and the void* pointer in order to prevent the user having to Lancelot> handle the cast. This is achieved by introducing the setting struct, Lancelot> and a set of templated member functions. The template parameter is the Lancelot> VAR_TYPES we want to the access the data for. The template ensures the Lancelot> return type of the get method and the parameter type of the set method Lancelot> matches the data type used to store the actual data. Seems nice. Lancelot> int get () It seems to me that it might be better if the get<> template itself knew about the storage equivalence between different var_ types and so code like this: Lancelot> + var = cmd->var.get + var_string_noescape, Lancelot> + var_optional_filename, Lancelot> + var_filename> (); ... could be simplified. Tom