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 C5C033858D35 for ; Sun, 25 Jun 2023 10:22:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C5C033858D35 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 1qDMss-0005Xi-2U; Sun, 25 Jun 2023 06:22:18 -0400 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=xA6CtHwHVn6vxEDCele4GDzXNQA7+gZBQIqX+kTYZ88=; b=msAXsPw85ja8 zRU2prJIyQC+GMIPKEhMFyMkp0M2lz4Sprrb4fhxmLFnQU+O61eGaBmOO0eUam/I/tzSR/w90nQ6s ujYBT08TnyFTjfLrz3/oSL93uT1S7cOGA7TJvXdXLwAD28H1nQUdVW9/HJd83AvFKUkxHXpWLIiRK UPA6LUTKHlb9n5LVS2WsBur2HgRMRcxg9ulJlrseH5zCQs+u8QVWyxfuipYTREZHRDKMVTvi3hcGJ AZ7gYZA/2P1twZIw/VQ4mT5+i+d8nntoRdOKrA3Jz696tkglnNTjfRX9Qt+WVi8PyIHK1IiDyiQp5 3AZATCmHPWCcvv1OgoSY/Q==; 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 1qDMsr-0008Tv-JF; Sun, 25 Jun 2023 06:22:17 -0400 Date: Sun, 25 Jun 2023 13:22:32 +0300 Message-Id: <83ttuvyh7b.fsf@gnu.org> From: Eli Zaretskii To: Simon Farre Cc: gdb-patches@sourceware.org, tom@tromey.com In-Reply-To: <20230625092116.252503-1-simon.farre.cx@gmail.com> (message from Simon Farre on Sun, 25 Jun 2023 11:21:16 +0200) Subject: Re: [PATCH v1] gdb/DAP Introduce new methods to to Pretty Printers References: <20230625092116.252503-1-simon.farre.cx@gmail.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > From: Simon Farre > Cc: tom@tromey.com, > eliz@gnu.org, > Simon Farre > Date: Sun, 25 Jun 2023 11:21:16 +0200 > > diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi > index 9cb97a9597d..61a7e49d1df 100644 > --- a/gdb/doc/python.texi > +++ b/gdb/doc/python.texi > @@ -1707,6 +1707,23 @@ Children may be hidden from display based on the value of @samp{set > print max-depth} (@pxref{Print Settings}). > @end defun > > +@defun pretty_printer.children_range (self, start, end) > +This method is optional but @value{GDBN} will call this method to > +be able to more effeciently compute a sub-range of children > +of the pretty-printers value. If the pretty printer is for an > +array-like type, it is recommended that this method is implemented > +as the DAP interpreter will make extended use of it. For an example on how > +to best implement this method @pxref{Writing a Pretty-Printer}. Not > +implementing this and @code{num_children} can have drastic effects on > +the performance of a DAP-interpreter debug session. > +@end defun Shouldn't this tell what will happen if this method is not implemented? The text side-steps that, but I think we should says something about that. > +@defun pretty_printer.num_children (self) > +@value{GDBN} can call this method to query how many children this pretty > +printer will return from a @code{pretty_printer.children ()} call. This method That should be just @code{pretty_printer.children}, without the parentheses. Also, please leave two spaces between sentences. Thanks. Reviewed-By: Eli Zaretskii