From: "Maciej W. Rozycki" <macro@embecosm.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, simonsobisch@web.de,
Tom Tromey <tom@tromey.com>,
Andrew Burgess <aburgess@redhat.com>
Subject: Re: [PATCH v4 7/8] GDB: Add a character string limiting option
Date: Wed, 9 Mar 2022 20:40:20 +0000 (GMT) [thread overview]
Message-ID: <alpine.DEB.2.20.2203092025330.11552@tpp.orcam.me.uk> (raw)
In-Reply-To: <83o82eewgh.fsf@gnu.org>
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.:
<https://sourceware.org/pipermail/gdb-patches/2021-December/184466.html>.
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
next prev parent reply other threads:[~2022-03-09 20:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-09 19:17 [PATCH v4 0/8] gdb: split array and string limiting options Maciej W. Rozycki
2022-03-09 19:17 ` [PATCH v4 1/8] GDB: Remove extraneous full stops from `set' command error messages Maciej W. Rozycki
2022-03-09 19:18 ` [PATCH v4 2/8] GDB/Python: Use None for `var_zuinteger_unlimited' value set to `unlimited' Maciej W. Rozycki
2022-03-09 19:18 ` [PATCH v4 3/8] GDB: Add `NUMBER' completion to `set' integer commands Maciej W. Rozycki
2022-03-09 19:18 ` [PATCH v4 4/8] GDB/testsuite: Tighten `set print elements' error check Maciej W. Rozycki
2022-03-09 19:18 ` [PATCH v4 5/8] GDB/testsuite: Add coverage for `print -elements' command Maciej W. Rozycki
2022-03-09 19:18 ` [PATCH v4 6/8] GDB: Allow arbitrary keywords in integer set commands Maciej W. Rozycki
2022-03-09 19:18 ` [PATCH v4 7/8] GDB: Add a character string limiting option Maciej W. Rozycki
2022-03-09 19:51 ` Eli Zaretskii
2022-03-09 20:40 ` Maciej W. Rozycki [this message]
2022-03-10 0:03 ` Maciej W. Rozycki
2022-03-10 6:35 ` Eli Zaretskii
2022-03-10 6:28 ` Eli Zaretskii
2022-03-10 10:08 ` Maciej W. Rozycki
2022-03-10 11:55 ` Eli Zaretskii
2022-03-10 12:25 ` Maciej W. Rozycki
2022-03-10 17:15 ` Tom Tromey
2022-03-30 10:38 ` Maciej W. Rozycki
2022-03-30 13:15 ` Pedro Alves
2022-03-30 14:17 ` Maciej W. Rozycki
2022-03-09 19:18 ` [PATCH v4 8/8] GDB/testsuite: Expand for character string limiting options Maciej W. Rozycki
2022-03-09 19:47 ` [PATCH v4 0/8] gdb: split array and " Simon Sobisch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.2203092025330.11552@tpp.orcam.me.uk \
--to=macro@embecosm.com \
--cc=aburgess@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=simonsobisch@web.de \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).