From: Pedro Alves <palves@redhat.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>,
Joel Brobecker <brobecker@adacore.com>,
Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] gdb: New set/show max-value-size command.
Date: Tue, 05 Jan 2016 15:55:00 -0000 [thread overview]
Message-ID: <568BE78A.6010705@redhat.com> (raw)
In-Reply-To: <20160105141241.GG4242@embecosm.com>
On 01/05/2016 02:12 PM, Andrew Burgess wrote:
> +/* It is critical that the MAX_VALUE_SIZE is always greater than the size
> + of LONGEST, otherwise GDB will not be able to parse integer values from
> + the CLI; for example if the MAX_VALUE_SIZE could be set to 1 then GDB
> + would be unable to parse "set max-value-size 2".
> +
> + As we want a consistent GDB experience across hosts with different sizes
> + of LONGEST, this arbitrary minimum value was selected, so long as this
> + is bigger than LONGEST of all GDB supported hosts we're fine. */
> +
> +#define MIN_VALUE_FOR_MAX_VALUE_SIZE 16
> +
> +/* Implement the "set max-value-size" command. */
> +
> +static void
> +set_max_value_size (char *args, int from_tty,
> + struct cmd_list_element *c)
> +{
> + gdb_assert (max_value_size == -1 || max_value_size >= 0);
> + gdb_assert (sizeof (LONGEST) < MIN_VALUE_FOR_MAX_VALUE_SIZE);
Make the second one a gdb_static_assert, and put it next to the
MIN_VALUE_FOR_MAX_VALUE_SIZE definition.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2016-01-05 15:55 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-11 21:38 [PATCH 0/2] Problems with gdb.mi/mi-vla-fortran.exp Andrew Burgess
2015-12-11 21:38 ` [PATCH 2/3] gdb: Set max-value-size before running tests Andrew Burgess
2016-01-01 9:48 ` Joel Brobecker
2016-01-01 9:53 ` Joel Brobecker
2016-01-05 14:14 ` Andrew Burgess
2015-12-11 21:38 ` [PATCH 1/3] gdb: New set/show max-value-size command Andrew Burgess
2016-01-01 9:43 ` Joel Brobecker
2016-01-05 14:12 ` Andrew Burgess
2016-01-05 15:55 ` Pedro Alves [this message]
2016-01-05 16:24 ` Eli Zaretskii
2016-01-06 11:41 ` Andrew Burgess
2016-01-20 10:59 ` PING: " Andrew Burgess
2016-01-20 11:23 ` Eli Zaretskii
2016-01-20 15:23 ` Andrew Burgess
2016-01-28 15:11 ` PING #2: " Andrew Burgess
2016-02-01 3:21 ` Joel Brobecker
2016-02-13 21:40 ` [testsuite patch] testsuite regression: gdb.fortran/vla-value-sub.exp gdb.fortran/vla-value-sub-finish.exp [Re: [PATCH 1/3] gdb: New set/show max-value-size command.] Jan Kratochvil
2016-02-14 0:51 ` Andrew Burgess
2016-02-14 8:20 ` [commit] " Jan Kratochvil
2016-02-14 4:38 ` Joel Brobecker
2015-12-11 21:38 ` [PATCH 3/3] gdb: Guard against undefined behaviour in mi-vla-fortran.exp Andrew Burgess
2016-01-01 11:08 ` Joel Brobecker
2016-01-05 14:15 ` Andrew Burgess
2016-01-01 7:34 ` [PATCH 0/2] Problems with gdb.mi/mi-vla-fortran.exp Joel Brobecker
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=568BE78A.6010705@redhat.com \
--to=palves@redhat.com \
--cc=andrew.burgess@embecosm.com \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/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).