From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113989 invoked by alias); 26 Nov 2015 12:38:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 113969 invoked by uid 89); 26 Nov 2015 12:38:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 26 Nov 2015 12:38:14 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id B6B3D68E02; Thu, 26 Nov 2015 12:38:13 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAQCcCKk031263; Thu, 26 Nov 2015 07:38:12 -0500 Message-ID: <5656FD34.3090803@redhat.com> Date: Thu, 26 Nov 2015 12:38:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Andrew Burgess , gdb-patches@sourceware.org Subject: Re: [PATCH 6/7] gdb: Add an error when 'list -' reaches the start of a file. References: <3cbf859f648e8f9df42755149ecac45a17603eca.1448411122.git.andrew.burgess@embecosm.com> In-Reply-To: <3cbf859f648e8f9df42755149ecac45a17603eca.1448411122.git.andrew.burgess@embecosm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-11/txt/msg00554.txt.bz2 On 11/25/2015 12:34 AM, Andrew Burgess wrote: > > diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c > index be84f81..5e7ef0a 100644 > --- a/gdb/cli/cli-cmds.c > +++ b/gdb/cli/cli-cmds.c > @@ -946,6 +946,9 @@ list_command (char *arg, int from_tty) > listed. */ > if (arg[0] == '-') > { > + if (get_first_line_listed () == 1) > + error ("Already at the start of %s.", Wrap text in _(). > + symtab_to_filename_for_display (cursal.symtab)); > print_source_lines (cursal.symtab, > max (get_first_line_listed () > - get_lines_to_list (), 1), > > diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp > index 1b9d4e6..87878f6 100644 > --- a/gdb/testsuite/gdb.base/list.exp > +++ b/gdb/testsuite/gdb.base/list.exp > @@ -244,6 +244,10 @@ proc test_list_forward {} { > } > > pass "successive list commands to page forward ($testcnt tests)" > + > + gdb_test "list" "Line number 44 out of range; \[^\r\n\]+ has 43 lines\." \ > + "End of file error after \"list\" command." Lowercase first word and no period at end. > + gdb_test "list" "Line number 44 out of range; \[^\r\n\]+ has 43 lines\." \ > + "End of file error after using 'return' to repeat the list command." Ditto. > + > gdb_stop_suppressing_tests > } > > @@ -324,6 +332,10 @@ proc test_list_backwards {} { > } > > pass "$testcnt successive \"list -\" commands to page backwards" > + > + gdb_test "list -" "Already at the start of .*\." \ > + "Beginning of file error after \"list -\" command." Ditto. OK with those fixed. Thanks, Pedro Alves