From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by sourceware.org (Postfix) with ESMTPS id 720B63861035 for ; Fri, 8 Jan 2021 00:59:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 720B63861035 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wr1-f54.google.com with SMTP id q18so7402191wrn.1 for ; Thu, 07 Jan 2021 16:59:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rPIoMc8LshA2+dDw25+vF9lMZSCLheuF/+cnXchaeDM=; b=BKPBe5U6Hbe2/dHxGVnB0AFXd0oaHi6eLYwyzvGpY1dWnF61/qbrOp6Ig/WTDj3Fm/ NzGEhxTxuG+XaUKAI+PRgpw5WMItKvUkpQ4qvtzvdrkMe8bq/hHZAZxgNxmEwv3v3Rs6 tq2ih8oyIXHRnYn3quV3i90pWnTrz0JaE5Ev5kyzj+8MWFJTiaXKKcreN6ryDD6OuRu0 sAsp0TSJEB0GzUckPNDar9bCDIegld+PczdwJIW0jQXlcDhhWfqHBa8CulZmvaeJc1Id ZvT6KZsTTWlKK5UKcHXH2U/m1PGektr7KpWDXWt9/Z0WLThlje0cdCD4IDftVl/q881j P+Fg== X-Gm-Message-State: AOAM530q6F2PSy+2TKPMLUCF7OFtVAlyO6GKwK87i5o/pLYbVx6PcWwH 94kIh8dEMAM6uL8ZK+tGaHvY4amZL/CE+Q== X-Google-Smtp-Source: ABdhPJz6IguSHJI9ngwJULO8Q4fTl0xO66aw2jfqKFtQHYtr/v3hUPIB/ZD97gdF781+66v4izeyZw== X-Received: by 2002:a05:6000:100f:: with SMTP id a15mr1069656wrx.300.1610067568622; Thu, 07 Jan 2021 16:59:28 -0800 (PST) Received: from ?IPv6:2001:8a0:f91f:e900:1d90:d745:3c32:c159? ([2001:8a0:f91f:e900:1d90:d745:3c32:c159]) by smtp.gmail.com with ESMTPSA id h3sm10105304wmm.4.2021.01.07.16.59.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 16:59:27 -0800 (PST) Subject: Re: [PATCH] gdb: improve command completion for 'print', 'x', and 'display' To: Andrew Burgess , Simon Marchi Cc: gdb-patches@sourceware.org References: <20201116154221.240877-1-andrew.burgess@embecosm.com> <05be3103-96e3-6e2d-902a-a1e35a166389@simark.ca> <20201127111358.GX2729@embecosm.com> From: Pedro Alves Message-ID: <4bf6746a-c002-4273-edb5-dab2e1b284c3@palves.net> Date: Fri, 8 Jan 2021 00:59:25 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20201127111358.GX2729@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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, 08 Jan 2021 00:59:31 -0000 On 27/11/20 11:13, Andrew Burgess wrote: > Previously when analysing /FMT strings for tab completion we > considered two possibilities, either the user has typed '/', or the > user has typed '/' followed by an alpha-numeric character, as these > are the only valid FMT string characters. > > This meant that if the user type, for example '/@' and then tried to > tab complete gdb would use an uninitialised variable. > > Currently only the first character after the '/' is checked to see if > it is alpha-numeric, so if a user typed '/x@@' then gdb would be happy > to treat this as a FMT string. > > Given the goal of this change was primarily to allow tab completion of > symbols later in the command when a /FMT was used then I decided to > just make the /FMT skipping less smart. Now any characters after the > '/' up to the first white space, will be treated as a FMT string. Do we already have a test for this? Thanks, Pedro Alves