This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PING #2: Re: [PATCH 1/3] gdb: New set/show max-value-size command.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: gdb-patches at sourceware dot org, Pedro Alves <palves at redhat dot com>
- Date: Mon, 1 Feb 2016 07:21:46 +0400
- Subject: Re: PING #2: Re: [PATCH 1/3] gdb: New set/show max-value-size command.
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1449869721 dot git dot andrew dot burgess at embecosm dot com> <57e2731e179d11c584e8cde994ab1e822a9893b0 dot 1449869722 dot git dot andrew dot burgess at embecosm dot com> <20160101094309 dot GC12416 at adacore dot com> <20160105141241 dot GG4242 at embecosm dot com> <83a8ok570f dot fsf at gnu dot org> <20160106114049 dot GJ4242 at embecosm dot com> <20160120105921 dot GW4242 at embecosm dot com> <20160120152257 dot GA7299 at embecosm dot com> <20160128151045 dot GQ3338 at embecosm dot 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