From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by sourceware.org (Postfix) with ESMTPS id C0190388A409 for ; Fri, 20 Nov 2020 13:47:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C0190388A409 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-wm1-f52.google.com with SMTP id 1so9857376wme.3 for ; Fri, 20 Nov 2020 05:47:40 -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:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TZ7ZMjGc2vPIzq5WQswjR1PG3tKvMeVsccVaTxCjJs8=; b=DSVO9rrVavJgN1MqCnhJ3RCnF8XT+iVuvuxbcG1/fHUsVDRf15Elo257xcHSWXMLqE FyU67JFoCH6qLAZbcmjXOMhhtzJ/ecEM5TbMjN7x3y4Hl9s7Ho8aBB5PjwXALzwxxKzc 15uzRZsFn5WIeZte4cWPe9NhTdvsZqNjDNo11Wc2buceG/9EUvi7+ApCe+7GRBn6L6g3 GDewGgXoAYOoZqQM7/QWR6SzmF3umG8stMq1PK07SALAB97GMsIHZPY723Mq8TlhjB3+ fS7hPTMJCnforon3yMk2JF8zoXUepAmDSoPqCWmT6oSb42bHv1HOU2zh2sZ0CpotXF6P ecMg== X-Gm-Message-State: AOAM533vf5YEpOdRIRF6pHLbAuEE01sdL9gXEMBF41NMk/qsg2TnjgLt bqI1Jim/GW9PiZR9sl9cn2+SLWu0TKWBHw== X-Google-Smtp-Source: ABdhPJwxilvlkgZpDYaANRnqkSGrdorTkuM3W0vJFpHwtc6aUyNj5vd8WfoMuvdVe1bvgalbmErG6w== X-Received: by 2002:a7b:ca43:: with SMTP id m3mr10144540wml.25.1605880059220; Fri, 20 Nov 2020 05:47:39 -0800 (PST) Received: from ?IPv6:2001:8a0:f91f:e900:642f:5bb0:6cba:b1bd? ([2001:8a0:f91f:e900:642f:5bb0:6cba:b1bd]) by smtp.gmail.com with ESMTPSA id y2sm5134883wrn.31.2020.11.20.05.47.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Nov 2020 05:47:38 -0800 (PST) Subject: Re: [PATCH] gdb: improve command completion for 'print', 'x', and 'display' To: Andrew Burgess , Tom Tromey References: <20201116154221.240877-1-andrew.burgess@embecosm.com> <87r1oqk5kj.fsf@tromey.com> <20201119101431.GU2729@embecosm.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Fri, 20 Nov 2020 13:47:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20201119101431.GU2729@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 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, 20 Nov 2020 13:47:42 -0000 On 11/19/20 10:14 AM, Andrew Burgess wrote: >> Andrew> The /FMT specification on the print command currently breaks command >> Andrew> completion, so: >> >> Note that this is PR cli/16256 >> >> Andrew> + if (ISALNUM (text[1]) || ISSPACE(text[1])) >> >> Missing space before a paren here. >> >> Andrew> + { >> Andrew> + /* Skip over the actual format specification. */ >> Andrew> + while (*text != '\0' && !ISSPACE (*text)) >> Andrew> + ++text; >> >> There's skip_spaces and skip_to_space for this kind of thing.. > Thanks for the suggestion. I pushed the patch below to address > this issue. I assumed it was on purpose that those weren't used, since you've included safe-ctype.h and are (rightfully IMO) using ISSPACE and not isspace. skip_spaces/skip_to_space use isspace not ISSPACE. Probably doesn't make a difference in practice. Not sure there's any locale where isspace/ISSPACE return a different result. ISSPACE is cheaper, so maybe we should make skip_spaces/skip_to_space use it.