From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0C0ED3860C08 for ; Thu, 26 May 2022 11:46:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0C0ED3860C08 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-370-Y4kBa1zAPvW9Cyv8Hd-jZw-1; Thu, 26 May 2022 07:46:47 -0400 X-MC-Unique: Y4kBa1zAPvW9Cyv8Hd-jZw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52FD680159B; Thu, 26 May 2022 11:46:47 +0000 (UTC) Received: from [10.97.116.42] (ovpn-116-42.gru2.redhat.com [10.97.116.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A83071121315; Thu, 26 May 2022 11:46:45 +0000 (UTC) Message-ID: Date: Thu, 26 May 2022 08:46:43 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v5 3/8] GDB: Add `NUMBER' completion to `set' integer commands To: "Maciej W. Rozycki" Cc: gdb-patches@sourceware.org, Simon Sobisch , Tom Tromey , Andrew Burgess References: From: Bruno Larsen In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Thu, 26 May 2022 11:46:52 -0000 Hi Maciej On 5/26/22 07:09, Maciej W. Rozycki wrote: > Hi Bruno, > >>> Index: src/gdb/cli/cli-decode.c >>> =================================================================== >>> --- src.orig/gdb/cli/cli-decode.c >>> +++ src/gdb/cli/cli-decode.c >>> @@ -989,6 +989,8 @@ integer_unlimited_completer (struct cmd_ >>> NULL, >>> }; >>> + if (*text == '\0') >>> + tracker.add_completion (make_unique_xstrdup ("NUMBER")); >>> complete_on_enum (tracker, keywords, text, word); >>> } >> >> Seeing as the point of "complete_on_enum" is to add all keywords to the >> tracker, why not add "NUMBER" as a keyword? The only possible unfavorable side >> effect I can think of would be GDB completing N to NUMBER, and personally >> I feel abstracting away how the option would be added is more important than >> not adding this completion option. > > This just follows the existing logic in `parse_option' and is really a > special case. I am inconvinced that there is a benefit from getting the > completion broken visibly to the user for the sake of avoiding a manual > call in the code. Sorry. I don't really think `complete set print elements N` would naturally occur, so I don't really think it would break completion from a user standpoint. However, I think we can agree to disagree here, since you do away with this function later on, and I'm fine with how you decided to work on that patch. FWIW, your series is fine by me (but I can't approve it for pushing, like I mentioned yesterday). Cheers! Bruno Larsen