From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 5F8B33858C74 for ; Wed, 9 Mar 2022 20:40:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F8B33858C74 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x334.google.com with SMTP id k29-20020a05600c1c9d00b003817fdc0f00so2186804wms.4 for ; Wed, 09 Mar 2022 12:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=0leXsly89vIxhVAYwVlNQls5xiCpyze/5LjwrS25dQ0=; b=MP6fnoHZeOs11RAwQkQ2bF6LPOszNtsjyb0mYV/v6ihYqlvu8HUDNX5DAmzAAtWCZK 68xxXsaT+ZGyL4cHpcmvYWLcv3R7GwXVBW31TF2LOfuo+OXvyHYdWqA8Dl3EK3SpHSO6 quiHT4LuKLb1alKzvLgBr251vJ20y8heG75typAhmbRiimp51Hyd3D6UwLLpYMz0c6/x D/F3skiV+O1sARwI8mlzZT7t6/QWVQ5g4HjiqEMyB/frL020iMhKCh4nAuXuRvHesuAm uFXd3p2r/xq0w4+AzVbWZUXu1+aUUxkfvXfL7J9HOnrr/qMHJe3yE+n7u61X67XMk3Ji 7+9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=0leXsly89vIxhVAYwVlNQls5xiCpyze/5LjwrS25dQ0=; b=h7VnL5sHvt//SuY9Q8kxF+lfgIJM4SKiEdPxCJpLvq6X4F5JPDUvI4Dd6LKOqzlDYz kWWiEGcUNkjXejWBVJtZ9lg4Ahm/1t1Ve3eg0UCSuOq6EKjIHHCnMA2OKzOELlNgnHVX Y0ayxfknNz2LEcx1HJ+Ra7mD89ryeuJDGTtmR1cRrdkWmypYpfzZmjd3E6Gpxmy2iuJn SacsH7vIPdq/UEb6ZHooFsl1rUdW5IwAlQOYuYSTY1MZk/Y+MXQptHDy3gEgbH0xEGyt gO4Pn8nQmzGri7973moCBpeWep2nXLjus56zapCERyZnwM7k0CD9nw0tRhq56NmomhJZ PDZg== X-Gm-Message-State: AOAM533gIT2AAKdxbB70DPkFMfunu7/3PIj3DwPKAykgKDOswOSEcFtB aDlwN9nOUB4qTorzV/vH1yZ0mZ2qjRAgGg== X-Google-Smtp-Source: ABdhPJxxH3csPT1oYqaKhk4czGG0rYAGhBsBKHmqbZiJJpGtbwMKZUQHicOf38ra/3D2c5XTvHQlfg== X-Received: by 2002:a1c:7909:0:b0:389:b5d0:84f with SMTP id l9-20020a1c7909000000b00389b5d0084fmr940068wme.11.1646858424429; Wed, 09 Mar 2022 12:40:24 -0800 (PST) Received: from tpp.orcam.me.uk (tpp.orcam.me.uk. [2001:8b0:154:0:ea6a:64ff:fe24:f2fc]) by smtp.gmail.com with ESMTPSA id n9-20020a1c7209000000b00389a616615csm6312930wmc.2.2022.03.09.12.40.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Mar 2022 12:40:24 -0800 (PST) Date: Wed, 9 Mar 2022 20:40:20 +0000 (GMT) From: "Maciej W. Rozycki" To: Eli Zaretskii cc: gdb-patches@sourceware.org, simonsobisch@web.de, Tom Tromey , Andrew Burgess Subject: Re: [PATCH v4 7/8] GDB: Add a character string limiting option In-Reply-To: <83o82eewgh.fsf@gnu.org> Message-ID: References: <83o82eewgh.fsf@gnu.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 09 Mar 2022 20:40:26 -0000 On Wed, 9 Mar 2022, Eli Zaretskii wrote: > > --- src.orig/gdb/NEWS > > +++ src/gdb/NEWS > > @@ -119,6 +119,17 @@ show ada source-charset > > values for this follow the values that can be passed to the GNAT > > compiler via the '-gnati' option. The default is ISO-8859-1. > > > > +set print characters LIMIT > > +show print characters > > +print -characters LIMIT > > + This new setting is like 'set print elements', but controls how many > > "This new setting" is okay for "set print characters", but not for > "print -characters". I suggest to move "print -characters" to after > the description, and then to say that its effect is the same as a > temporary use of "set print characters". OK. I will update it in v5. > > +@item -characters @var{number-of-characters}|@code{elements}|@code{unlimited} > > +Set limit on string characters to print. The value @code{elements} > > +causes the limit on array elements to print to be used. The value > ^^^^^^^^^^^^^^ > "characters", not "array elements", right? No, this is as intended. With a character string `foo' and this command: (gdb) print -characters elements foo the limit previously set by `set print elements' will be used (which is usually the setting for array elements). Likewise: (gdb) print -characters elements -elements 5 foo will print up to 5 characters regardless of the current limit set by `set print characters', and the `-elements' option usually applies to array elements. > And, btw, we actually count bytes, not characters, right? If the > string contains multibyte sequences, we don't count characters. I > think this should be mentioned. We do count characters not bytes, as previously discussed; cf.: . Multibyte sequences comprising a single character are treated as such. This change does not affect it. > > +@item -elements @var{number-of-elements}|@code{unlimited} > > +Set limit on array elements and optionally string characters to print. > > +See @ref{set print characters} and the @code{-characters} option above > ^ > Please insert a comma after the closing brace. Some relatively old > versions of makeinfo require that. OK. I will update it in v5. (Now that you mention it I remember it from the old days.) > > +for when this option applies to strings. The value @code{unlimited} > > +causes there to be no limit. Related setting: @ref{set print elements}. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > This is not a very good idea. Texinfo is not HTML, so the results > produced for this in some formats will look awkward or even downright > incorrect English. It is better to use something like: > > @xref{set print elements}, for a related CLI command. Likewise. Thank you for your review. Maciej