From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by sourceware.org (Postfix) with ESMTPS id A8CED384A01A for ; Fri, 8 Jan 2021 15:08:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A8CED384A01A 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-f50.google.com with SMTP id i9so9343147wrc.4 for ; Fri, 08 Jan 2021 07:08:18 -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:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=M4bKPHaLY8ousTkRl3DGUEh5n/Ph15+kKRUd4ewHoVI=; b=nlzopR2QF1P3xfb0v1EKuMMPoXCsF4q6Rkgr8SLdTAHS3l6RKGJlA5u8UTD9SNpAcK x3Vc/iG5eSmlJbD7zK7/2uCDui56CzmllMDWh1ys6pUIM/NIZ0tVqYkP611iQwv5MtWP xaA73Q6olAOJ9FcO4zY0rvlXDiwl+nbFG6EpNAQNpi/aroPMAZ6mlQXzR8eY1v3NtV6E Z2lnnfKM3qTBKBWrnXM1aTrZ7TA9i5cluHE/0O3BpQ1LKDyGnWocIUXZBu/D1rjBWjDQ Ig9znpbBJHlBVY14Lz6lbHw5HCoAF/gkIrgfBgyk+35jEWUqhA/t52SmyHWRh3F+oL9p UeMQ== X-Gm-Message-State: AOAM531vFuwNTg2vOl+II/URRAAY+6d5t5lH4xuCDwwPZaKrP1Villp9 d0AK9eoZldoY6pweI+WBBa6wkz8qkCboJw== X-Google-Smtp-Source: ABdhPJxqPW9gusB+luPiIFGvNrz0exWU1EcRAluLIS+Se0T6s7RcfF+7g54ox5qyL4hiHmGvOsnAbA== X-Received: by 2002:adf:d843:: with SMTP id k3mr4119577wrl.346.1610118497091; Fri, 08 Jan 2021 07:08:17 -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 f77sm11970067wmf.42.2021.01.08.07.08.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Jan 2021 07:08:15 -0800 (PST) Subject: Re: [PATCH] gdb: improve command completion for 'print', 'x', and 'display' From: Pedro Alves To: Andrew Burgess Cc: Simon Marchi , gdb-patches@sourceware.org References: <20201116154221.240877-1-andrew.burgess@embecosm.com> <05be3103-96e3-6e2d-902a-a1e35a166389@simark.ca> <20201127111358.GX2729@embecosm.com> <4bf6746a-c002-4273-edb5-dab2e1b284c3@palves.net> <20210108103452.GX2945@embecosm.com> Message-ID: <05d3b626-3933-80fc-2bc6-ea17d8d3ae32@palves.net> Date: Fri, 8 Jan 2021 15:08:00 +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: <20210108103452.GX2945@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 15:08:19 -0000 On 08/01/21 10:34, Andrew Burgess wrote: > * Pedro Alves [2021-01-08 00:59:25 +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? > > No. My bad. > > How about the below? LGTM, thanks!