public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org, Pedro Alves <palves@redhat.com>
Subject: Re: PING #2: Re: [PATCH 1/3] gdb: New set/show max-value-size command.
Date: Mon, 01 Feb 2016 03:21:00 -0000	[thread overview]
Message-ID: <20160201032146.GH4008@adacore.com> (raw)
In-Reply-To: <20160128151045.GQ3338@embecosm.com>

> > gdb/ChangeLog:
> > 
> > 	* value.c (max_value_size): New variable.
> > 	(MIN_VALUE_FOR_MAX_VALUE_SIZE): New define.
> > 	(show_max_value_size): New function.
> > 	(check_type_length_before_alloc): New function.
> > 	(allocate_value_contents): Call check_type_length_before_alloc.
> > 	(set_value_enclosing_type): Likewise.
> > 	(_initialize_values): Add set/show handler for max-value-size.
> > 	* NEWS: Mention new set/show command.
> > 
> > gdb/doc/ChangeLog:
> > 
> > 	* gdb.texinfo (Value Sizes): New section.
> > 	(Data): Add the 'Value Sizes' node to the menu.
> > 
> > gdb/testsuite/ChangeLog:
> > 
> > 	* gdb.base/max-value-size.c: New file.
> > 	* gdb.base/max-value-size.exp: New file.
> > 	* gdb.base/huge.exp: Disable max-value-size for this test.

Sorry about the delay in reviewing this. Pre-approved after
a couple of trivial fixes...

> > +++ b/gdb/testsuite/gdb.base/max-value-size.c
> > @@ -0,0 +1,26 @@
> > +/* This testcase is part of GDB, the GNU debugger.
> > +
> > +   Copyright (C) 2016 Free Software Foundation, Inc.
> > +
> > +   This program is free software; you can redistribute it and/or modify
> > +   it under the terms of the GNU General Public License as published by
> > +   the Free Software Foundation; either version 3 of the License, or
> > +   (at your option) any later version.
> > +
> > +   This program is distributed in the hope that it will be useful,
> > +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> > +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > +   GNU General Public License for more details.
> > +
> > +   You should have received a copy of the GNU General Public License
> > +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> > +
> > +char one;
> > +char ten [10];
> > +char one_hundred [100];

Tiny formatting nit: No space before the '[' in the two lines
above.

> > --- a/gdb/value.c
> > +++ b/gdb/value.c
> > @@ -955,13 +955,86 @@ allocate_value_lazy (struct type *type)
> >    return val;
> >  }
> >  
> > +/* The maximum size, in bytes, that GDB will try to allocate for a value.
> > +   The initial value of 64k was not selected for any specific reason, it is
> > +   just a reasonable starting point.  */
> > +
> > +static int max_value_size = 65536; /* 64k bytes */
> > +
> > +/* It is critical that the MAX_VALUE_SIZE is at least as bit as the size of

bit -> big

That's it. Thanks for this patch!
-- 
Joel

  reply	other threads:[~2016-02-01  3:21 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
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 [this message]
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=20160201032146.GH4008@adacore.com \
    --to=brobecker@adacore.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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).