From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 9EBE33857687 for ; Mon, 31 Oct 2022 19:22:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9EBE33857687 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id DA6FD1E11E; Mon, 31 Oct 2022 15:22:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1667244152; bh=/+0cinGHIQfuUcO5A3EsbhSv/+01EdkHxf/1bHqFWkU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=N0DxmWzOb6U9ah33i47pweKSSSMlZtEiVHJeen7Lll5CBlcrcUYi5RwxzeMqadTXY MVytJzrLIlczNakSxpVl/4qtFOLBErV8J853Br0UUczEa18OI4izpRFm6G4t2HIR8m F04Iu3s7ojHVN7DOx2TRopTbfcYfTHsf5CD5m6Kw= Message-ID: <146021e6-41cb-22d3-6cec-06aed5818867@simark.ca> Date: Mon, 31 Oct 2022 15:22:31 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v7 2/4] GDB: Allow arbitrary keywords in integer set commands Content-Language: en-US To: Simon Marchi , "Maciej W. Rozycki" , gdb-patches@sourceware.org Cc: Simon Sobisch , Tom Tromey References: <03f4f878-6423-e905-d65c-7a4e9aa45490@polymtl.ca> From: Simon Marchi In-Reply-To: <03f4f878-6423-e905-d65c-7a4e9aa45490@polymtl.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 10/31/22 14:48, Simon Marchi via Gdb-patches wrote: > > > On 10/29/22 09:53, Maciej W. Rozycki wrote: >> Rather than just `unlimited' allow the integer set commands (or command >> options) to define arbitrary keywords for the user to use, removing >> hardcoded arrangements for the `unlimited' keyword. >> >> Remove the confusingly named `var_zinteger', `var_zuinteger' and >> `var_zuinteger_unlimited' `set'/`show' command variable types redefining >> them in terms of `var_uinteger', `var_integer' and `var_pinteger', which >> have the range of [0;UINT_MAX], [INT_MIN;INT_MAX], and [0;INT_MAX] each. >> >> Following existing practice `var_pinteger' allows extra negative values >> to be used, however unlike `var_zuinteger_unlimited' any number of such >> values can be defined rather than just `-1'. >> >> The "p" in `var_pinteger' stands for "positive", for the lack of a more >> appropriate unambiguous letter, even though 0 obviously is not positive; >> "n" would be confusing as to whether it stands for "non-negative" or >> "negative". > > We don't have to restrict ourselves to a single letter. By the end of > reading the commit message, I had already forgotten what the `p` stood > for. Ideas: > > - var_non_negative_integer > - var_zero_or_positive_integer > - some better suggestion > > On the other hand, is there any reason why "pintegers" couldn't be > stored as var_uinteger, with the proper literal_def? > > Simon I forgot: I didn't have significant comments on the code itself. Maybe the only strange thing is the fact that you pass the list of extra literals in the erased_args structure. I don't think it should be there, it's not something that need to be type-erased (cast to void). Simon