From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yXViKsYkhGIszwYAWB0awg (envelope-from ) for ; Tue, 17 May 2022 18:42:14 -0400 Received: by simark.ca (Postfix, from userid 112) id A07791E220; Tue, 17 May 2022 18:42:14 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=G82rCxDH; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2BE6D1E01D for ; Tue, 17 May 2022 18:42:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5DC453857C50 for ; Tue, 17 May 2022 22:42:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DC453857C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652827333; bh=SSGSMM+Nkv07RIsTiX3RI4Uv0ir8Hv8GxkQl1LrU2PI=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=G82rCxDH7wPyMZWFUQgOQkFOR0t4UyIi/IbQs6+i/T1sKT1qUo8xeIeudilTcg1gQ HVfsXRjpYdRwQMaJbU/ANNwCX0Iuu67v9wr7nvpdiJxsRoHP13WCaHyMBGlUuSjiMu JRu3QLEW7LigH9XldVlW2zYnV9LZVkdWA0aBZeNU= Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id 6437E3858C2C for ; Tue, 17 May 2022 22:41:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6437E3858C2C Received: from Plymouth (unknown [IPv6:2a02:390:9086:0:f30c:1b72:fbbc:137c]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 9B75088580; Tue, 17 May 2022 22:41:51 +0000 (UTC) Date: Tue, 17 May 2022 23:41:48 +0100 To: Andrew Burgess Subject: Re: [PATCH 2/2] gdb/python: improve formatting of help text for user defined commands Message-ID: <20220517224111.4mrvufw4ph7v2toq@Plymouth> References: <58a7e3085365af2ac05409b78f6d15bf5240cd2c.1652784658.git.aburgess@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <58a7e3085365af2ac05409b78f6d15bf5240cd2c.1652784658.git.aburgess@redhat.com> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Tue, 17 May 2022 22:41:51 +0000 (UTC) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, > +/* See python-internal.h. */ > + > +gdb::unique_xmalloc_ptr > +gdbpy_fix_doc_string_indentation (gdb::unique_xmalloc_ptr doc) > +{ > + /* A structure used to track the white-space information on each line of > + DOC. */ > + struct line_whitespace > + { > + /* Constructor. OFFSET is the offset from the content_start of DOC, WS_COUNT > + is the number of whitespace characters starting at OFFSET, > + NON_WS_COUNT is the number of characters following WS_COUNT, this > + count can include additional white-space characters, but the first > + character of this sequence will always be non-white-space. LAST is > + true if this is the last line of DOC, otherwise LAST is false. */ It looks like the comment mentions parameters which do not exist : NON_WS_COUNT and LAST. Are those from a previous implementation? > + line_whitespace (size_t offset, int ws_count) > + : m_offset (offset), > + m_ws_count (ws_count) > + { /* Nothing. */ } > diff --git a/gdb/testsuite/gdb.python/py-doc-reformat.exp b/gdb/testsuite/gdb.python/py-doc-reformat.exp > new file mode 100644 > index 00000000000..9c203f88b4b > --- /dev/null > +++ b/gdb/testsuite/gdb.python/py-doc-reformat.exp > @@ -0,0 +1,278 @@ > [...] > +# The INPUT_DOCS must start with 2 space characters, followed by the > +# 3-quote characters to start the doc string, and must end with the > +# final 3-quote characters. If this is not true then an error is > +# thrown, and this function immediately returns. > +proc test { input_docs expected_output } { > + global idx > + > + set local_idx $idx > + incr idx > + > + with_test_prefix "test ${local_idx}" { > + > + verbose -log "Start of: test_cmd ${local_idx}" > + verbose -log "Input:\n${input_docs}" Are those leftover from the development? > + > + if { [string range $input_docs 0 4] != " \"\"\"" } { > + perror "Input string does not start with the required pattern" > + return > + } > + Best, Lancelot.