From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTPS id A5229399C037 for ; Fri, 4 Jun 2021 17:21:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A5229399C037 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 6E5B611779E; Fri, 4 Jun 2021 13:21:55 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id K2aOS64cQ+jM; Fri, 4 Jun 2021 13:21:55 -0400 (EDT) Received: from murgatroyd (75-166-132-3.hlrn.qwest.net [75.166.132.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 120F9117797; Fri, 4 Jun 2021 13:21:55 -0400 (EDT) From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Add PROP_VARIABLE References: <20210526192327.2954317-1-tromey@adacore.com> X-Attribution: Tom Date: Fri, 04 Jun 2021 11:21:54 -0600 In-Reply-To: (Simon Marchi's message of "Fri, 28 May 2021 23:36:16 -0400") Message-ID: <87eedho899.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-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 04 Jun 2021 17:21:57 -0000 >> + /* Set the name of the variable that holds this property's value, >> + and set this property to be of kind PROP_VARIABLE. */ >> + void set_name (const char *name) >> + { >> + m_kind = PROP_VARIABLE; >> + m_data.varname = name; >> + } Simon> The logic of the getters / setters is that they match 1:1 the kinds Simon> (although I see PROP_TYPE doesn't match original_type / Simon> set_original_type, maybe a mistake). That makes it easier to follow: Simon> you are only allowed to call the getter matching the prop's kind, Simon> otherwise there's a logic error and you wouldn't get what you expect. Simon> So I'd suggest maybe naming the enumerator PROP_VARIABLE_NAME, and then Simon> have the variable_name / set_variable_name getter / setter. I made this change and will send an updated version soon. Tom