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 9676B3858D28 for ; Tue, 20 Jun 2023 16:19:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9676B3858D28 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 1qBe4g-0004aJ-4z; Tue, 20 Jun 2023 12:19:22 -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=8uNR3V+EbJ8vW+aiIgG7lS2fjtKX1IV2O3XF9RaRbV0=; b=WUf2k8xCt0bQ f6NXf4oLarJJN9IvNfL/ItWM+hKGJTSbH4AVhn1FFo5l00m7ZycdscVuORJ5eoIFysdtdeByjqNDc Zki47PO8Ka2RlPNggU2n1Bd5Dq6BGS8b0xQJIC6rHkGriSG4hi7mbQ9eYufhx1g0GZc5I4WK/MMFs beGDbmlOFSF4sfCWufF3BT8slIcpN6lJH5hOjNMlk2ge0cCA2oFxSGftakjfTY5/M8QYAlpOipPD1 VDNY41taQ3v9bcIRq5k+OU0bNS1gt6E4dBhGSaCDPcXunA+cHZgySRZxtlRb00wyLR9wafaaJ+IY6 TLcUGLfALU66QXEtbBvfKA==; 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 1qBe4f-0004cr-Ku; Tue, 20 Jun 2023 12:19:21 -0400 Date: Tue, 20 Jun 2023 19:19:28 +0300 Message-Id: <83mt0u5cof.fsf@gnu.org> From: Eli Zaretskii To: Bruno Larsen Cc: gdb-patches@sourceware.org In-Reply-To: <20230620155259.2476415-3-blarsen@redhat.com> (message from Bruno Larsen on Tue, 20 Jun 2023 17:52:58 +0200) Subject: Re: [PATCH v2 2/4] gdb/cli: Improve UX when using list with no args References: <20230620155259.2476415-1-blarsen@redhat.com> <20230620155259.2476415-3-blarsen@redhat.com> X-Spam-Status: No, score=1.7 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,T_SCC_BODY_TEXT_LINE 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: > From: Bruno Larsen > Cc: eliz@gnu.org, > Bruno Larsen > Date: Tue, 20 Jun 2023 17:52:58 +0200 > > gdb/NEWS | 7 +++++++ > gdb/cli/cli-cmds.c | 36 +++++++++++++++++++++++++++++++-- > gdb/doc/gdb.texinfo | 7 +++++-- > gdb/source.c | 18 +++++++++++++++++ > gdb/source.h | 4 ++++ > gdb/testsuite/gdb.base/list.exp | 8 ++++---- > 6 files changed, 72 insertions(+), 8 deletions(-) Thanks. > +* Using the 'list' command with no arguments in a situation where the > + command would attempt to list past the end of the file, instead of > + erroring out, it will now warn the user that the end of file has been > + reached and the default location will be printed. The default location > + is either the last solitary line printed (if there was one) or around > + the main function. The first sentence is too complex. I suggest to rephrase: Using the 'list' command with no arguments in a situation where the command would attempt to list past the end of the file now warns the user that the end of file has been reached, and prints the default location. Previously, it would error out. The default location for this purpose is the last solitary line printed, if there was one, else the lines around the main function. > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -9142,9 +9142,12 @@ Print lines centered around the beginning of function > @item list > Print more lines. If the last lines printed were printed with a > @code{list} command, this prints lines following the last lines > -printed; however, if the last line printed was a solitary line printed > +printed; however, if those lines are past the end of the source > +file, or if the last line printed was a solitary line printed > as part of displaying a stack frame (@pxref{Stack, ,Examining the > -Stack}), this prints lines centered around that line. > +Stack}), this prints lines centered around that line. If no ^^ Two spaces there, please. > +@code{list} command has been used and no solitary line was printed, > +it prints the lines around the function @code{main}. Reviewed-By: Eli Zaretskii