From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id tH+vNYWPTWJGNAAAWB0awg (envelope-from ) for ; Wed, 06 Apr 2022 09:03:01 -0400 Received: by simark.ca (Postfix, from userid 112) id C95D41F344; Wed, 6 Apr 2022 09:03:01 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 5B5ED1ED17 for ; Wed, 6 Apr 2022 09:03:01 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 092D03853804 for ; Wed, 6 Apr 2022 13:03:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 092D03853804 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649250181; bh=KF9FbL3EDENfiOSx0Gf2sDgzGCF+1HY1IJ1gGwh33ro=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=U31g3apgGBAnf2oaU+tGowXeZ7JwxjT81m2u2f9w+x8m0vQMJ0cDiLBOLPTP6J9fz ZcSCRd4pg9kX2FM8Pbe/cBCbIcPtSmI0qYz2iUiA5bLWIdjW47SEUnq1Qu5ccsraur O0wmMOM6u2N6MYAX/JccG42CyxTqNzpm6Wocw9o4= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 4E2C8385EC44 for ; Wed, 6 Apr 2022 13:02:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4E2C8385EC44 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 236D2Uj7026146 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 6 Apr 2022 09:02:35 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 236D2Uj7026146 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (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 B701E1ED17; Wed, 6 Apr 2022 09:02:30 -0400 (EDT) Message-ID: Date: Wed, 6 Apr 2022 09:02:30 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCHv2 07/16] gdb/tui: avoid theoretical bug with 'tui reg' command Content-Language: en-US To: Andrew Burgess , gdb-patches@sourceware.org References: <65d3d60cb9a62242939c65aa3c05fb03201d739a.1649246539.git.aburgess@redhat.com> In-Reply-To: <65d3d60cb9a62242939c65aa3c05fb03201d739a.1649246539.git.aburgess@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 6 Apr 2022 13:02:30 +0000 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2022-04-06 08:04, Andrew Burgess via Gdb-patches wrote: > While looking at the 'tui reg' command as part of another patch, I > spotted a theoretical bug. > > The 'tui reg' command takes the name of a register group, but also > handles partial register group matches, though the partial match has to > be unique. The current command logic goes: > > With the code as currently written, if a target description named a > register group either 'prev' or 'next' then GDB would see this as an > ambiguous register name, and refuse to switch groups. > > Naming a register group 'prev' or 'next' seems pretty unlikely, but, > by adding a single else block we can prevent this problem. > > Now, if there's a 'prev' or 'next' register group, the user will not > be able to select the group directly, the 'prev' and 'next' names will > always iterate through the available groups instead. But at least the > user could select their groups by iteration, rather than direct > selection. This looks ok to me. All previous patches also look ok, but I didn't reply to each one, since they are mostly obvious. Simon