From: Pedro Alves <palves@redhat.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 6/7] gdb: Add an error when 'list -' reaches the start of a file.
Date: Thu, 26 Nov 2015 12:38:00 -0000 [thread overview]
Message-ID: <5656FD34.3090803@redhat.com> (raw)
In-Reply-To: <3cbf859f648e8f9df42755149ecac45a17603eca.1448411122.git.andrew.burgess@embecosm.com>
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
next prev parent reply other threads:[~2015-11-26 12:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-25 0:34 [PATCH 0/7] Minor changes to 'list' command Andrew Burgess
2015-11-25 0:34 ` [PATCH 5/7] gdb: 'list' command, tweak handling of +/- arguments Andrew Burgess
2015-11-26 12:38 ` Pedro Alves
2015-11-25 0:34 ` [PATCH 6/7] gdb: Add an error when 'list -' reaches the start of a file Andrew Burgess
2015-11-26 12:38 ` Pedro Alves [this message]
2015-11-25 0:34 ` [PATCH 2/7] gdb: Use NULL instead of 0 for pointer comparison Andrew Burgess
2015-11-26 12:37 ` Pedro Alves
2015-11-25 0:34 ` [PATCH 7/7] gdb: Extend help text for 'list' command Andrew Burgess
2015-11-26 12:38 ` Pedro Alves
2015-12-10 10:08 ` Andrew Burgess
2015-12-10 16:24 ` Eli Zaretskii
2015-11-25 0:34 ` [PATCH 1/7] gdb: Make lines_to_list variable static Andrew Burgess
2015-11-26 12:37 ` Pedro Alves
2015-11-25 0:34 ` [PATCH 4/7] gdb: Make test names unique in list.exp Andrew Burgess
2015-11-26 12:37 ` Pedro Alves
2015-11-25 0:34 ` [PATCH 3/7] gdb: Small code restructure for list_command Andrew Burgess
2015-11-26 12:37 ` Pedro Alves
2015-12-11 23:28 ` [PATCH 0/7] Minor changes to 'list' command Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5656FD34.3090803@redhat.com \
--to=palves@redhat.com \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox