public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: "Maciej W. Rozycki" <macro@embecosm.com>, gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>, Tom Tromey <tom@tromey.com>,
	Simon Sobisch <simonsobisch@web.de>
Subject: Re: [PATCH v8 5/6] GDB: Add a character string limiting option
Date: Mon, 16 Jan 2023 14:35:14 -0500	[thread overview]
Message-ID: <50d5003a-b5ff-aba0-24db-c0c2048e96d7@polymtl.ca> (raw)
In-Reply-To: <alpine.DEB.2.20.2211240519070.19931@tpp.orcam.me.uk>



On 11/24/22 06:22, Maciej W. Rozycki wrote:
> From: Andrew Burgess <andrew.burgess@embecosm.com>
> 
> This commit splits the `set/show print elements' option into two.  We 
> retain `set/show print elements' for controlling how many elements of an 
> array we print, but a new `set/show print characters' setting is added 
> which is used for controlling how many characters of a string are 
> printed.
> 
> The motivation behind this change is to allow users a finer level of 
> control over how data is printed, reflecting that, although strings can 
> be thought of as arrays of characters, users often want to treat these 
> two things differently.
> 
> For compatibility reasons by default the `set/show print characters' 
> option is set to `elements', which makes the limit for character strings 
> follow the setting of the `set/show print elements' option, as it used 
> to.  Using `set print characters' with any other value makes the limit 
> independent from the `set/show print elements' setting, however it can 
> be restored to the default with the `set print characters elements' 
> command at any time.
> 
> A corresponding `-characters' option for the `print' command is added, 
> with the same semantics, i.e. one can use `elements' to make a given 
> `print' invocation follow the limit of elements, be it set with the 
> `-elements' option also given with the same invocation or taken from the 
> `set/show print elements' setting, for characters as well regardless of 
> the current setting of the `set/show print characters' option.
> 
> The GDB changes are all pretty straightforward, just changing references 
> to the old 'print_max' to use a new `get_print_max_chars' helper which 
> figures out which of the two of `print_max' and `print_max_chars' values 
> to use.
> 
> Likewise, the documentation is just updated to reference the new setting 
> where appropriate.
> 
> To make people's life easier the message shown by `show print elements' 
> now indicates if the setting also applies to character strings:
> 
> (gdb) set print characters elements
> (gdb) show print elements
> Limit on string chars or array elements to print is 200.
> (gdb) set print characters unlimited
> (gdb) show print elements
> Limit on array elements to print is 200.
> (gdb) 
> 
> which keeps it the same as it used to be, although in other contexts the 
> setting is described as applying to array elements only, e.g.:
> 
> (gdb) help set print elements
> Set limit on array elements to print.
> "unlimited" causes there to be no limit.

I think it would be helpful to say here that if this value influences
"set print characters", if "set print characters" is set to "elements".

Otherwise, the patch LGTM:

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon

  reply	other threads:[~2023-01-16 19:35 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24 11:21 [PATCH v8 0/6] gdb: split array and string limiting options Maciej W. Rozycki
2022-11-24 11:21 ` [PATCH v8 1/6] GDB: Fix documentation for `theclass' parameters in cli-decode.c Maciej W. Rozycki
2023-01-12 18:36   ` Simon Marchi
2023-01-18 21:56     ` Maciej W. Rozycki
2022-11-24 11:22 ` [PATCH v8 2/6] GDB: Add missing inline documentation for `add_setshow_cmd_full' Maciej W. Rozycki
2023-01-12 18:40   ` Simon Marchi
2023-01-18 23:24     ` [COMMITTED PATCH v9 2.0/6] " Maciej W. Rozycki
2023-01-18 23:24       ` [COMMITTED PATCH v9 2.1/6] GDB: Correct inline documentation for `add_setshow_cmd_full_erased' Maciej W. Rozycki
2023-01-18 23:24       ` [COMMITTED PATCH v9 2.2/6] GDB: Add missing inline documentation for `add_setshow_cmd_full' Maciej W. Rozycki
2022-11-24 11:22 ` [PATCH v8 3/6] GDB: Add references to erased args in cli-decode.c Maciej W. Rozycki
2023-01-12 18:46   ` Simon Marchi
2023-01-18 23:41     ` Maciej W. Rozycki
2022-11-24 11:22 ` [PATCH v8 4/6] GDB: Allow arbitrary keywords in integer set commands Maciej W. Rozycki
2022-11-24 11:57   ` Eli Zaretskii
2023-01-12 20:48   ` Simon Marchi
2023-01-19 21:17     ` Maciej W. Rozycki
2023-01-19 21:18       ` [COMMITTED PATCH v9 " Maciej W. Rozycki
2023-01-20 17:16       ` [PATCH v8 " Simon Marchi
2022-11-24 11:22 ` [PATCH v8 5/6] GDB: Add a character string limiting option Maciej W. Rozycki
2023-01-16 19:35   ` Simon Marchi [this message]
2023-01-19 21:17     ` Maciej W. Rozycki
2023-01-19 21:19       ` [COMMITTED PATCH v9 " Maciej W. Rozycki
2023-01-21  9:57         ` Simon Sobisch
2023-01-21 18:45           ` Simon Marchi
2023-01-21 19:29             ` Simon Sobisch
2023-02-07  5:17               ` Joel Brobecker
2022-11-24 11:23 ` [PATCH v8 6/6] GDB/testsuite: Expand for character string limiting options Maciej W. Rozycki
2023-01-16 21:07   ` Simon Marchi
2023-01-19 21:18     ` Maciej W. Rozycki
2023-01-19 21:20       ` [COMMITTED PATCH v9 " Maciej W. Rozycki
2022-12-08 12:05 ` [PING][PATCH v8 0/6] gdb: split array and " Maciej W. Rozycki
2023-01-09 12:27 ` [PING^2][PATCH " Maciej W. Rozycki

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=50d5003a-b5ff-aba0-24db-c0c2048e96d7@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@embecosm.com \
    --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).