From: Eli Zaretskii <eliz@gnu.org>
To: "Maciej W. Rozycki" <macro@embecosm.com>
Cc: gdb-patches@sourceware.org, aburgess@redhat.com, tom@tromey.com,
Richard.Bunt@arm.com
Subject: Re: [PATCH v2 5/5] GDB: Introduce limited array lengths while printing values
Date: Thu, 12 Jan 2023 12:04:30 +0200 [thread overview]
Message-ID: <835ydckr0x.fsf@gnu.org> (raw)
In-Reply-To: <alpine.DEB.2.20.2301112357100.7841@tpp.orcam.me.uk> (macro@embecosm.com)
> Date: Thu, 12 Jan 2023 09:02:23 +0000 (GMT)
> From: "Maciej W. Rozycki" <macro@embecosm.com>
> cc: Andrew Burgess <aburgess@redhat.com>, Tom Tromey <tom@tromey.com>,
> Richard Bunt <Richard.Bunt@arm.com>
>
> --- src.orig/gdb/NEWS
> +++ src/gdb/NEWS
> @@ -354,6 +354,12 @@ GDB now supports floating-point on Loong
> Disabling this can cause a performance penalty when there are a lot of
> symbols to load, but is useful for debugging purposes.
>
> +* The 'set print elements' setting now helps when printing large arrays.
> + If an array would otherwise exceed max-value-size, but 'print elements'
> + is set such that the number of elements to print is less than or equal
> + to 'max-value-size', GDB will now still print the array, however only
> + 'max-value-size' worth of data will be added into the value history.
The wording here needs to be changed, because max-value-size is not
about the number of elements, it's about the amount of memory needed
for those elements. So this part:
but 'print elements'
is set such that the number of elements to print is less than or equal
to 'max-value-size'
should be reworded.
> --- src.orig/gdb/doc/gdb.texinfo
> +++ src/gdb/doc/gdb.texinfo
> @@ -11756,6 +11756,14 @@ When @value{GDBN} starts, this limit is
> Setting @var{number-of-elements} to @code{unlimited} or zero means
> that the number of elements to print is unlimited.
>
> +When printing very large arrays, whose size is greater than
> +@code{max-value-size} (@pxref{set max-value-size,,max-value-size}),
> +if the @code{print elements} is set such that the size of the elements
> +being printed is less than or equal to @code{max-value-size}, then
> +@value{GDBN} will print the array (up to the @code{print elements} limit),
> +and only @code{max-value-size} worth of data will be added into the value
> +history (@pxref{Value History, ,Value History}).
> +
> @item show print elements
> Display the number of elements of a large array that @value{GDBN} will print.
>
> @@ -14171,6 +14179,7 @@ may indicate a value that is incorrectly
> @value{GDBN} to try and allocate an overly large amount of memory.
>
> @table @code
> +@anchor{set max-value-size}
> @kindex set max-value-size
> @item set max-value-size @var{bytes}
> @itemx set max-value-size unlimited
This part is OK.
Thanks.
next prev parent reply other threads:[~2023-01-12 10:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 9:01 [PATCH v2 0/5] gdb: introduce " Maciej W. Rozycki
2023-01-12 9:01 ` [PATCH v2 1/5] GDB: Ignore `max-value-size' setting with value history accesses Maciej W. Rozycki
2023-01-13 16:18 ` Andrew Burgess
2023-01-20 13:41 ` Maciej W. Rozycki
2023-01-12 9:01 ` [PATCH v2 2/5] GDB: Fix the mess with value byte/bit range types Maciej W. Rozycki
2023-01-12 9:02 ` [PATCH v2 3/5] GDB: Only make data actually retrieved into value history available Maciej W. Rozycki
2023-01-12 9:02 ` [PATCH v2 4/5] GDB/testsuite: Add `-nonl' option to `gdb_test' Maciej W. Rozycki
2023-01-12 9:02 ` [PATCH v2 5/5] GDB: Introduce limited array lengths while printing values Maciej W. Rozycki
2023-01-12 10:04 ` Eli Zaretskii [this message]
2023-01-12 10:58 ` 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=835ydckr0x.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=Richard.Bunt@arm.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=macro@embecosm.com \
--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).