public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org, "aciej W. Rozycki" <macro@embecosm.com>
Subject: Re: [PATCH] gdb: split array and string limiting options
Date: Wed, 8 Dec 2021 22:01:21 -0500	[thread overview]
Message-ID: <79a90d9f-15a7-c1e9-cc2b-5c7bfa0fc470@polymtl.ca> (raw)
In-Reply-To: <20211007131451.849029-1-andrew.burgess@embecosm.com>

> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index a6f207a41a7..a92727bb3f1 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -9994,10 +9994,15 @@
>  Set printing of array indexes.
>  Related setting: @ref{set print array-indexes}.
>  
> +@item -characters @var{number-of-characters}|@code{unlimited}
> +Set limit on string character to print.  The value @code{unlimited}

character -> characters?

> diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
> index d45df5fd113..98b5cceed3f 100644
> --- a/gdb/python/py-value.c
> +++ b/gdb/python/py-value.c
> @@ -623,6 +623,7 @@ valpy_format_string (PyObject *self, PyObject *args, PyObject *kw)
>        "actual_objects",		/* See set print object on|off.  */
>        "static_members",		/* See set print static-members on|off.  */
>        /* C non-bool options.  */
> +      "max_characters", 	/* See set print elements N.  */

I guess the comment should say "see set print characters N".

We would need a corresponding doc update for this, in python.texi.

> diff --git a/gdb/valprint.h b/gdb/valprint.h
> index e1dae2cc8fc..f58d6ba7b0e 100644
> --- a/gdb/valprint.h
> +++ b/gdb/valprint.h
> @@ -54,6 +54,9 @@ struct value_print_options
>       "unlimited".  */
>    unsigned int print_max;
>  
> +  /* Maxiumum number of string chars to print */

Maxiumum -> Maximum.  End with a period + 2 spaces.

> +  unsigned int print_smax;

I would suggest using a clearer name, like print_max_chars.

Although Eli raised a good question, do we limit the number bytes of
characters?  What would happen if we print a wide char or UTF-8 string?

Simon

  parent reply	other threads:[~2021-12-09  3:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 13:14 Andrew Burgess
2021-10-07 13:38 ` Eli Zaretskii
2021-11-02 10:04 ` [PING][PATCH] " Maciej W. Rozycki
2021-11-09 16:45 ` [PING^2][PATCH] " Maciej W. Rozycki
2021-11-16 12:40 ` [PING^3][PATCH] " Maciej W. Rozycki
2021-11-23 21:37 ` [PING^4][PATCH] " Maciej W. Rozycki
2021-11-30 13:15 ` [PING^5][PATCH] " Maciej W. Rozycki
2021-12-08 23:19 ` [PING^6][PATCH] " Maciej W. Rozycki
2021-12-09  3:01 ` Simon Marchi [this message]
2021-12-14 16:35   ` [PATCH] " Maciej W. Rozycki
2022-01-14 19:52 ` Tom Tromey

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=79a90d9f-15a7-c1e9-cc2b-5c7bfa0fc470@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@embecosm.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).