From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailsec106.isp.belgacom.be (mailsec106.isp.belgacom.be [195.238.20.102]) by sourceware.org (Postfix) with ESMTPS id 795B03858D20 for ; Wed, 17 Apr 2024 19:02:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 795B03858D20 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=skynet.be Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=skynet.be ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 795B03858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.238.20.102 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713380563; cv=none; b=yEsUmLAToLLj2JegI80nWwc1Fuj5mpAIeYc0W8d2z8z8Ip3uc86ClE8+zAaTwDsVRylluzWevXF8dOhLCXIdD/z5ejFT+asOY3Cvg/p8FUblCFLe/osKkfWvbhFP/fBjuxCNtoOX2CNiljhj9ACaXqVHD5MGx0/4RiUbmTYQsEY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713380563; c=relaxed/simple; bh=qUPSncUdS+2L31cMrnFbwcgvOCn51Pvg5qBGn8uQWgE=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=rzkLjDOqYn/j1Jw4LzLwKqq/dWdtB0jCwt/tFuTGm1Ymb1c8MyUBVP/+w9bPXOGjknfFnXucJ29yrBL19qT3ClikRnA2EqummsWPWADji71wcGfShcr2NMQ92kIoaRBXNSkU2hyunk4/ppg7myLbpQt+3XnmWrK+VMkMF0SeW6Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=skynet.be; i=@skynet.be; q=dns/txt; s=rmail; t=1713380554; x=1744916554; h=message-id:subject:from:to:date:in-reply-to:references: content-transfer-encoding:mime-version; bh=qUPSncUdS+2L31cMrnFbwcgvOCn51Pvg5qBGn8uQWgE=; b=P1NX1kkr94i9j0RlhM4qJVnPmtIxmzaFHnVEOy7EjHK4nYz3tNQLVKyP KGV9cCU+D0i7jvfzmFvtrVfhDYYD1lDEWkQm1FbloT22QxNdWi3duNl0f m6EYjYxGJSwW/MCI2Kw3/5E1+hdM/GlJibM/0p/qbvdxZ0W6BdzE3wKQd E=; X-CSE-ConnectionGUID: knjyYAvpSIigBcdKfEPCEw== X-CSE-MsgGUID: WKqvG12bRAOWFVB6wYhVug== X-ExtLoop: 1 X-ThreatScanner-Verdict: Negative X-IPAS-Result: =?us-ascii?q?A2HVAAAAHCBm/1uGgG0NTYEJCYFGiXeRaAOcM4FWgX4PA?= =?us-ascii?q?QEBAQEBAQEBCUQEAQGFBgKIISc0CQ4BAgQBAQEBAwIDAQEBAQEBAQEGAQEBB?= =?us-ascii?q?QEBAQEBAQYEAQEBAoEZhS+DMgGDeAEBAQMjBGILGAICJgICVgYBuDB6fzOBA?= =?us-ascii?q?YR72TaBaoEaLoguAYFZhCOEQDaBVUSBFYE7UIEfPoRDg1uCRiIEgWmMckmBG?= =?us-ascii?q?IRxcoFTgnMaS4FihGEJS30cA1kyAVUTFgIbFA0kIwIpPgMJChACFgMdCQsEM?= =?us-ascii?q?BEJCyYDKgY5AhIMBgYGWyAWCQQjAwgEAxBAAyBwEQMEGgQLB3WBfIE6BBNEA?= =?us-ascii?q?gEQgTKFPYRVDIEdg34DCimEMEtxhBuBTAYrD1UdQAMLbT01FBsGIgGgOD4kE?= =?us-ascii?q?AEsED4UL4EBTGAJDh4RklePW6JUNAeEFoFbBgyfWTOqNJhiIKNDhSKBZIIWb?= =?us-ascii?q?VOCaFEorHSBMQIHCwEBAwmJIoFIAQE?= IronPort-PHdr: A9a23:KJpyRRGcIhxH00sN/ryBap1GfzpLhN3EVzX9CrIZgr5DOp6u447ld BSGo6k33RmQAtWTwskHotSVmpioYXYH75eFvSJKW713fDhBpOMo2icNO4q7M3D9N+PgdCcgH c5PBxdP9nC/NlVJSo6l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uvDzFrv7SeTnfb/Lr8QS6OBBX55FQqPUcsJTbpKfG6yG3vpnojheqP3EJ4YhMZ1N0wL /23QPACuogu IronPort-HdrOrdr: A9a23:FT0n9658NEXLVWVQ9gPXwN3XdLJyesId70hD6qkXc203TiX4ra CTdZsguiMc5Ax9ZJhko7690cq7MBbhHPxOirX5VI3KNDUO+lHIEGgI1+HfKlPbdxEWutQtt5 tdTw== X-Talos-CUID: 9a23:Yvi4rmE7tEJgjm1KqmJk8kwFK+k7akb8zXj6KEObB0tRY5CKHAo= X-Talos-MUID: 9a23:6eHR1Av5tqWiZCgwys2nuxJ7Kugxua6UIWcyv6ss5da1NRJtNGLI X-IronPort-Anti-Spam-Filtered: true X-ProximusIPWarmup: true Received: from 91.134-128-109.adsl-dyn.isp.belgacom.be (HELO [192.168.1.19]) ([109.128.134.91]) by relay.proximus.be with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2024 21:02:31 +0200 Message-ID: <9021a25190192d2bf1ad8ec404e23912754f6843.camel@skynet.be> Subject: Re: [PATCH] Disallow trailing whitespace in docstrings From: Philippe Waroquiers To: Tom Tromey , gdb-patches@sourceware.org Date: Wed, 17 Apr 2024 21:02:28 +0200 In-Reply-To: <20240417140651.4007054-1-tromey@adacore.com> References: <20240417140651.4007054-1-tromey@adacore.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,TXREP 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: Looks ok to me, thanks Philippe On Wed, 2024-04-17 at 08:06 -0600, Tom Tromey wrote: > This patch changes the docstring self-test to verify that there is no > trailing whitespace at the end of lines. A few existing docstrings > had to be updated. > --- > gdb/breakpoint.c | 4 ++-- > gdb/cris-tdep.c | 2 +- > gdb/infcmd.c | 6 +++--- > gdb/macrocmd.c | 2 +- > gdb/reverse.c | 8 ++++---- > gdb/skip.c | 2 +- > gdb/typeprint.c | 2 +- > gdb/unittests/command-def-selftests.c | 19 +++++++++++++++++-- > 8 files changed, 30 insertions(+), 15 deletions(-) >=20 > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index 6d8adc62664..880cc57037c 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -14597,7 +14597,7 @@ command" [PROBE_MODIFIER] [LOCATION] [thread THRE= ADNUM]\n\ > \t[-force-condition] [if CONDITION]\n\ > PROBE_MODIFIER shall be present if the command is to be placed in a\n\ > probe point. Accepted values are `-probe' (for a generic, automatically= \n\ > -guessed probe type), `-probe-stap' (for a SystemTap probe) or \n\ > +guessed probe type), `-probe-stap' (for a SystemTap probe) or\n\ > `-probe-dtrace' (for a DTrace probe).\n\ > LOCATION may be a linespec, address, or explicit location as described\n= \ > below.\n\ > @@ -15028,7 +15028,7 @@ Do \"help tracepoints\" for info on other tracepo= int commands.")); > Set a static tracepoint at location or marker.\n\ > \n\ > strace [LOCATION] [if CONDITION]\n\ > -LOCATION may be a linespec, explicit, or address location (described bel= ow) \n\ > +LOCATION may be a linespec, explicit, or address location (described bel= ow)\n\ > or -m MARKER_ID.\n\n\ > If a marker id is specified, probe the marker with that name. With\n\ > no LOCATION, uses current execution address of the selected stack frame.= \n\ > diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c > index dd013d531ab..1fc30c0b193 100644 > --- a/gdb/cris-tdep.c > +++ b/gdb/cris-tdep.c > @@ -3828,7 +3828,7 @@ _initialize_cris_tdep () > _("Show the current CRIS version."), > _("\ > Set to 10 for CRISv10 or 32 for CRISv32 if autodetection fails.\n\ > -Defaults to 10. "), > +Defaults to 10."), > set_cris_version, > NULL, /* FIXME: i18n: Current CRIS version > is %s. */ > diff --git a/gdb/infcmd.c b/gdb/infcmd.c > index 10a964a90d7..a53c6c91828 100644 > --- a/gdb/infcmd.c > +++ b/gdb/infcmd.c > @@ -3077,7 +3077,7 @@ shell that will start the program (specified by the= \"$SHELL\" environment\n\ > variable). Input and output redirection with \">\", \"<\", or \">>\"\n\ > are also allowed.\n\ > \n\ > -With no arguments, uses arguments last specified (with \"run\" or \n\ > +With no arguments, uses arguments last specified (with \"run\" or\n\ > \"set args\"). To cancel previous arguments and run with no arguments,\= n\ > use \"set args\" without arguments.\n\ > \n\ > @@ -3303,7 +3303,7 @@ which means to set the ignore count of that breakpo= int to N - 1 (so that\n\ > the breakpoint won't break until the Nth time it is reached).\n\ > \n\ > If non-stop mode is enabled, continue only the current thread,\n\ > -otherwise all the threads in the program are continued. To \n\ > +otherwise all the threads in the program are continued. To\n\ > continue all stopped threads in non-stop mode, use the -a option.\n\ > Specifying -a and an ignore count simultaneously is an error.")); > add_com_alias ("c", continue_cmd, class_run, 1); > @@ -3329,7 +3329,7 @@ RUN_ARGS_HELP)); > add_com ("interrupt", class_run, interrupt_command, > _("Interrupt the execution of the debugged program.\n\ > If non-stop mode is enabled, interrupt only the current thread,\n\ > -otherwise all the threads in the program are stopped. To \n\ > +otherwise all the threads in the program are stopped. To\n\ > interrupt all running threads in non-stop mode, use the -a option.")); > =20 > cmd_list_element *info_registers_cmd > diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c > index ddabfede0f5..a84ea57a7ba 100644 > --- a/gdb/macrocmd.c > +++ b/gdb/macrocmd.c > @@ -480,7 +480,7 @@ expression work together to yield a pre-processed exp= ression."), > add_info ("macro", info_macro_command, > _("Show the definition of MACRO, and it's source location.\n\ > Usage: info macro [-a|-all] [--] MACRO\n\ > -Options: \n\ > +Options:\n\ > -a, --all Output all definitions of MACRO in the current compilatio= n\ > unit.\n\ > -- Specify the end of arguments and the beginning of the MAC= RO.")); > diff --git a/gdb/reverse.c b/gdb/reverse.c > index 11c76b4b335..ca11f83119b 100644 > --- a/gdb/reverse.c > +++ b/gdb/reverse.c > @@ -320,12 +320,12 @@ Execute backward until just before selected stack f= rame is called.")); > =20 > add_com ("bookmark", class_bookmark, save_bookmark_command, _("\ > Set a bookmark in the program's execution history.\n\ > -A bookmark represents a point in the execution history \n\ > +A bookmark represents a point in the execution history\n\ > that can be returned to at a later point in the debug session.")); > add_info ("bookmarks", info_bookmarks_command, _("\ > Status of user-settable bookmarks.\n\ > -Bookmarks are user-settable markers representing a point in the \n\ > -execution history that can be returned to later in the same debug \n\ > +Bookmarks are user-settable markers representing a point in the\n\ > +execution history that can be returned to later in the same debug\n\ > session.")); > add_cmd ("bookmark", class_bookmark, delete_bookmark_command, _("\ > Delete a bookmark from the bookmark list.\n\ > @@ -334,7 +334,7 @@ Argument is a bookmark number or numbers,\n\ > &deletelist); > add_com ("goto-bookmark", class_bookmark, goto_bookmark_command, _("\ > Go to an earlier-bookmarked point in the program's execution history.\n\ > -Argument is the bookmark number of a bookmark saved earlier by using \n\ > +Argument is the bookmark number of a bookmark saved earlier by using\n\ > the 'bookmark' command, or the special arguments:\n\ > start (beginning of recording)\n\ > end (end of recording)")); > diff --git a/gdb/skip.c b/gdb/skip.c > index f2818eccb34..e3448700247 100644 > --- a/gdb/skip.c > +++ b/gdb/skip.c > @@ -722,7 +722,7 @@ If you don't specify any numbers or ranges, we'll del= ete all skip entries."), > add_info ("skip", info_skip_command, _("\ > Display the status of skips.\n\ > Usage: info skip [NUMBER | RANGES]...\n\ > -You can specify numbers (e.g. \"info skip 1 3\"), \n\ > +You can specify numbers (e.g. \"info skip 1 3\"),\n\ > ranges (e.g. \"info skip 4-8\"), or both (e.g. \"info skip 1 3 4-8\").\n= \n\ > If you don't specify any numbers or ranges, we'll show all skips.")); > set_cmd_completer (c, complete_skip_number); > diff --git a/gdb/typeprint.c b/gdb/typeprint.c > index 4d0e764274a..7977bd2c4ae 100644 > --- a/gdb/typeprint.c > +++ b/gdb/typeprint.c > @@ -843,7 +843,7 @@ Available FLAGS are:\n\ > /x use hexadecimal notation when displaying sizes and offsets\n\ > of struct members\n\ > /d use decimal notation when displaying sizes and offsets\n\ > - of struct members ")); > + of struct members")); > set_cmd_completer (c, expression_completer); > =20 > c =3D add_com ("whatis", class_vars, whatis_command, > diff --git a/gdb/unittests/command-def-selftests.c b/gdb/unittests/comman= d-def-selftests.c > index 6936af740fc..6a9b194e680 100644 > --- a/gdb/unittests/command-def-selftests.c > +++ b/gdb/unittests/command-def-selftests.c > @@ -73,10 +73,25 @@ check_doc (struct cmd_list_element *commandlist, cons= t char *prefix) > "first line is not terminated with a '.' character"); > =20 > /* Checks the doc is not terminated with a new line. */ > - if (c->doc[strlen (c->doc) - 1] =3D=3D '\n') > + if (isspace (c->doc[strlen (c->doc) - 1])) > broken_doc_invariant > (prefix, c->name, > - "has a superfluous trailing end of line"); > + "has superfluous trailing whitespace"); > + > + for (const char *nl =3D strchr (c->doc, '\n'); > + nl !=3D nullptr; > + nl =3D strchr (nl + 1, '\n')) > + { > + if (nl =3D=3D c->doc) > + broken_doc_invariant (prefix, c->name, "has a leading newline"); > + else > + { > + /* \n\n is ok, so we check that explicitly here. */ > + if (isspace (nl[-1]) && nl[-1] !=3D '\n') > + broken_doc_invariant (prefix, c->name, > + "has whitespace before a newline"); > + } > + } > =20 > /* Check if this command has subcommands and is not an > abbreviation. We skip checking subcommands of abbreviations