From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75702 invoked by alias); 1 Feb 2016 03:21:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 75683 invoked by uid 89); 1 Feb 2016 03:21:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=reviewing, Hx-languages-length:2469, ten, news X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 01 Feb 2016 03:21:53 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 481381167EE; Sun, 31 Jan 2016 22:21:51 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Qh20UgiKMCxu; Sun, 31 Jan 2016 22:21:51 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id C589D116640; Sun, 31 Jan 2016 22:21:50 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 94010407D2; Mon, 1 Feb 2016 07:21:46 +0400 (RET) Date: Mon, 01 Feb 2016 03:21:00 -0000 From: Joel Brobecker To: Andrew Burgess Cc: gdb-patches@sourceware.org, Pedro Alves Subject: Re: PING #2: Re: [PATCH 1/3] gdb: New set/show max-value-size command. Message-ID: <20160201032146.GH4008@adacore.com> References: <57e2731e179d11c584e8cde994ab1e822a9893b0.1449869722.git.andrew.burgess@embecosm.com> <20160101094309.GC12416@adacore.com> <20160105141241.GG4242@embecosm.com> <83a8ok570f.fsf@gnu.org> <20160106114049.GJ4242@embecosm.com> <20160120105921.GW4242@embecosm.com> <20160120152257.GA7299@embecosm.com> <20160128151045.GQ3338@embecosm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160128151045.GQ3338@embecosm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2016-02/txt/msg00001.txt.bz2 > > 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 . */ > > + > > +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