diff options
author | Tom Tromey <tom@tromey.com> | 2018-04-25 08:52:00 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-06-05 11:02:52 -0600 |
commit | eb6af80922a56b67228f7564facc4cb4aa44a0ae (patch) | |
tree | cc1244f5cc7e4f8bf7fa8dde1e4e9d0a2fb449de /gdb/testsuite | |
parent | 5c4ce239a3ab9263163a0fe8e7487b39a41c43d1 (diff) | |
download | gdb-eb6af80922a56b67228f7564facc4cb4aa44a0ae.zip gdb-eb6af80922a56b67228f7564facc4cb4aa44a0ae.tar.gz gdb-eb6af80922a56b67228f7564facc4cb4aa44a0ae.tar.bz2 |
Add "continue" response to pager
This adds a "continue" response to the pager. If the user types "c"
in response to the pager prompt, pagination will be disabled for the
duration of one command -- but re-enabled afterward. This is handy if
you type a command that produces a lot of output, and you don't want
to baby-sit it by typing "return" each time the prompt comes up.
Tested by the buildbot.
gdb/ChangeLog
2018-06-05 Tom Tromey <tom@tromey.com>
PR cli/12326:
* NEWS: Add entry about pager.
* utils.c (pagination_disabled_for_command): New global.
(prompt_for_continue): Allow "c" response to prompt.
(reinitialize_more_filter): Clear
pagination_disabled_for_command.
(fputs_maybe_filtered): Check pagination_disabled_for_command.
gdb/doc/ChangeLog
2018-06-05 Tom Tromey <tom@tromey.com>
PR cli/12326:
* gdb.texinfo (Screen Size): Document "c" response to pagination
prompt.
gdb/testsuite/ChangeLog
2018-06-05 Tom Tromey <tom@tromey.com>
PR cli/12326:
* gdb.cp/static-print-quit.exp: Update.
* lib/gdb.exp (pagination_prompt): Update.
* gdb.base/page.exp: Use pagination_prompt. Add new tests.
* gdb.python/python.exp: Update.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/page.exp | 21 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/static-print-quit.exp | 10 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/python.exp | 12 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 3 |
5 files changed, 41 insertions, 13 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 0e98d7e..951c8db 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2018-06-05 Tom Tromey <tom@tromey.com> + + PR cli/12326: + * gdb.cp/static-print-quit.exp: Update. + * lib/gdb.exp (pagination_prompt): Update. + * gdb.base/page.exp: Use pagination_prompt. Add new tests. + * gdb.python/python.exp: Update. + 2018-06-04 Joel Brobecker <brobecker@adacore.com> * gdb.mi/list-thread-groups-no-inferior.exp: New testcase. diff --git a/gdb/testsuite/gdb.base/page.exp b/gdb/testsuite/gdb.base/page.exp index 47db79f..f7557d3 100644 --- a/gdb/testsuite/gdb.base/page.exp +++ b/gdb/testsuite/gdb.base/page.exp @@ -47,7 +47,7 @@ gdb_test "show pagination" "State of pagination is on.*" "pagination is on" gdb_test_no_output "set height 10" send_gdb "help\n" gdb_expect_list "paged help" \ - ".*---Type <return> to continue, or q <return> to quit---" { + ".*$pagination_prompt" { "List of classes of commands:" "" "aliases -- Aliases of other commands" @@ -60,6 +60,25 @@ gdb_expect_list "paged help" \ } gdb_test "q" +gdb_test_no_output "set height 5" +send_gdb "printf \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\"\n" +gdb_expect_list "paged count" \ + ".*$pagination_prompt" { + 1 + 2 + 3 + 4 +} +send_gdb "c\n" +gdb_expect_list "paged count remainder" "${gdb_prompt} " { + 5 + 6 + 7 + 8 + 9 + 10 + 11 +} gdb_exit return 0 diff --git a/gdb/testsuite/gdb.cp/static-print-quit.exp b/gdb/testsuite/gdb.cp/static-print-quit.exp index ab60a0c..22b0cf6 100644 --- a/gdb/testsuite/gdb.cp/static-print-quit.exp +++ b/gdb/testsuite/gdb.cp/static-print-quit.exp @@ -29,10 +29,10 @@ gdb_test_no_output "set height 2" set test "print c - <return>" gdb_test_multiple "print c" $test { - -re "\\$\[0-9\]+ = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n---Type <return>" { + -re "\\$\[0-9\]+ = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n--Type <RET>" { pass $test } - -re "\r\n---Type <return>" { + -re "\r\n--Type <RET>" { # gdb-7.1 did not crash with this testcase but it had the same bug. untested "bug does not reproduce" return 0 @@ -41,14 +41,14 @@ gdb_test_multiple "print c" $test { set test "print c - q <return>" gdb_test_multiple "" $test { - -re " to continue, or q <return>" { + -re " for more, q to quit, " { pass $test } } -set test "print c - to quit" +set test "print c - remainder" gdb_test_multiple "" $test { - -re " to quit---$" { + -re "c to continue without paging--$" { pass $test } } diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index 2780b78..1d7ea5b 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -143,13 +143,13 @@ gdb_test_no_output "set height $lines" set test "verify pagination beforehand" gdb_test_multiple "python print (\"\\n\" * $lines)" $test { - -re "---Type <return>" { + -re "--Type <RET>" { exp_continue } - -re " to continue, or q <return>" { + -re " for more, q to quit" { exp_continue } - -re " to quit---$" { + -re ", c to continue without paging--$" { pass $test } } @@ -159,13 +159,13 @@ gdb_test "python if gdb.execute('python print (\"\\\\n\" * $lines)', to_string=T set test "verify pagination afterwards" gdb_test_multiple "python print (\"\\n\" * $lines)" $test { - -re "---Type <return>" { + -re "--Type <RET>" { exp_continue } - -re " to continue, or q <return>" { + -re " for more, q to quit" { exp_continue } - -re " to quit---$" { + -re ", c to continue without paging--$" { pass $test } } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index ee66a38..aef580b 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -82,7 +82,8 @@ if ![info exists gdb_prompt] then { } # A regexp that matches the pagination prompt. -set pagination_prompt [string_to_regexp "---Type <return> to continue, or q <return> to quit---"] +set pagination_prompt \ + "--Type <RET> for more, q to quit, c to continue without paging--" # The variable fullname_syntax_POSIX is a regexp which matches a POSIX # absolute path ie. /foo/ |