From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id rWjlNoosFGE8SQAAWB0awg (envelope-from ) for ; Wed, 11 Aug 2021 16:01:14 -0400 Received: by simark.ca (Postfix, from userid 112) id CFFA21EDFB; Wed, 11 Aug 2021 16:01:14 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,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 056111E79C for ; Wed, 11 Aug 2021 16:01:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 661CD3985818 for ; Wed, 11 Aug 2021 20:01:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 661CD3985818 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628712073; bh=x0BWiLboko0TWkKiQngSYyNH2SnsSdgbCsFGVJ1sDyQ=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=PUJho4IEYaI+tn/szDv/EEzfzNMoSHCCl3yKF+6BNexFCiUBPhcM3t5KsMdxNQEL5 GHW9YTkJkLf2jb+aN7y/HmT8JtR5dRCl4v8ImzLTJlAQTVybL0EIsOdaaJbvbX12Wr HZI3841OdzUAG1IpizvRNcK2ByQ7aUR4Y/j7BPZo= Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id 4CE463985818 for ; Wed, 11 Aug 2021 20:00:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4CE463985818 Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::635]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 3DD8F82EC2; Wed, 11 Aug 2021 20:00:44 +0000 (UTC) Date: Wed, 11 Aug 2021 20:00:39 +0000 To: Simon Marchi Subject: Re: [PATCH v2 3/4] gdb: Have setter and getter callbacks for settings Message-ID: <20210811195946.ls3e2d2sbpt24o2e@ubuntu.lan> References: <20210808192302.3768766-1-lsix@lancelotsix.com> <20210808192302.3768766-4-lsix@lancelotsix.com> <727ab80a-c72d-960a-6d6e-a731aaa147dd@polymtl.ca> <20210810221852.bqbb6opnrlaqgob5@Plymouth> <7de0a03d-77bf-3b09-9a11-4a109afce8a8@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7de0a03d-77bf-3b09-9a11-4a109afce8a8@polymtl.ca> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Wed, 11 Aug 2021 20:00:44 +0000 (UTC) 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: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > Another option would be to use > > gdb::optional var; > > in cmd_list_element, and make it such that a setting can never exist in > an invalid state. Two constructor would exist, one to construct a > setting with a pointer to a buffer and another with the setter/getter. > There would be no need (I think) for set_p and set_accessors. This approach would be a problem within param_smob (gdb/guile/scm-param.c). This struct is memset initialized, so we cannot have one of its member which is not a PODType (see the redefinition of memset in gdbsupport/poison.h). We could have a pointer to a properly constructed setting within a param_smob plus some manual memory management, but I am not sure it is worth it. > > But otherwise, `valid` sounds good to me as well. I’ll go for that. Lancelot. > > Simon