From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 63AC33858D35 for ; Thu, 12 Jan 2023 10:04:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 63AC33858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFuRQ-0005SN-Bo; Thu, 12 Jan 2023 05:04:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=b7D2Z0Drfa+37I1LOLNXb5zrzGJrcYnjcMtbYYh0Ox8=; b=qGhZqJR4Scla Z2ofGHmXfCXxXX+U77o/dy3k+nYT5GsPi+XZkjsvAefFiUItcMjYOFpxjqcZqtfnXKgFl54BMBEA+ U2w2Lacq6/Kt5X7qv8iHFjnxwT21uQCpd2tjB8AuPYFNlV72Pp3rtwX/7zqtQr2fPMxwgdEXGjfzc 1GRbCkWQCMKt8HnSwpnNMdPbgXqtetEFqbeOLAhB1jtvQyg9sSQaSSKDqRXZynikWIZEEGeCNFJ+B uuRrgvVUPNbMTzeVwN6t3oOQLlcz4xpEdoyXyGHGjyge6XvAL0OKSSShv+INysvpKXMtMZJFuxTKQ H+/CDEWJFKoygXdxpZ0LoA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFuRC-0003hn-Ee; Thu, 12 Jan 2023 05:04:09 -0500 Date: Thu, 12 Jan 2023 12:04:30 +0200 Message-Id: <835ydckr0x.fsf@gnu.org> From: Eli Zaretskii To: "Maciej W. Rozycki" Cc: gdb-patches@sourceware.org, aburgess@redhat.com, tom@tromey.com, Richard.Bunt@arm.com In-Reply-To: (macro@embecosm.com) Subject: Re: [PATCH v2 5/5] GDB: Introduce limited array lengths while printing values References: X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Thu, 12 Jan 2023 09:02:23 +0000 (GMT) > From: "Maciej W. Rozycki" > cc: Andrew Burgess , Tom Tromey , > Richard Bunt > > --- 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.