public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Simon Marchi <simon.marchi@polymtl.ca>,
	"Maciej W. Rozycki" <macro@embecosm.com>,
	gdb-patches@sourceware.org
Cc: Simon Sobisch <simonsobisch@web.de>, Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH v7 2/4] GDB: Allow arbitrary keywords in integer set commands
Date: Mon, 31 Oct 2022 15:22:31 -0400	[thread overview]
Message-ID: <146021e6-41cb-22d3-6cec-06aed5818867@simark.ca> (raw)
In-Reply-To: <03f4f878-6423-e905-d65c-7a4e9aa45490@polymtl.ca>



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

  reply	other threads:[~2022-10-31 19:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-29 13:53 [PATCH v7 0/4] gdb: split array and string limiting options Maciej W. Rozycki
2022-10-29 13:53 ` [PATCH v7 1/4] GDB/Python: Use None for `var_zuinteger_unlimited' value set to `unlimited' Maciej W. Rozycki
2022-10-29 15:06   ` Eli Zaretskii
2022-10-29 13:53 ` [PATCH v7 2/4] GDB: Allow arbitrary keywords in integer set commands Maciej W. Rozycki
2022-10-29 15:07   ` Eli Zaretskii
2022-10-31 18:48   ` Simon Marchi
2022-10-31 19:22     ` Simon Marchi [this message]
2022-11-24 11:38       ` Maciej W. Rozycki
2022-10-29 13:53 ` [PATCH v7 3/4] GDB: Add a character string limiting option Maciej W. Rozycki
2022-10-29 15:11   ` Eli Zaretskii
2022-10-29 13:53 ` [PATCH v7 4/4] GDB/testsuite: Expand for character string limiting options Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=146021e6-41cb-22d3-6cec-06aed5818867@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@embecosm.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=simonsobisch@web.de \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).