+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.
+
2018-06-04 Tom Tromey <tom@tromey.com>
* ada-lang.h (ada_lookup_symbol_list): Update.
or by inferring from the last executable used, rather than the startup
default.
+* The pager now allows a "c" response, meaning to disable the pager
+ for the rest of the current command.
+
* The commands 'info variables/functions/types' now show the source line
numbers of symbol definitions when available.
+2018-06-05 Tom Tromey <tom@tromey.com>
+
+ PR cli/12326:
+ * gdb.texinfo (Screen Size): Document "c" response to pagination
+ prompt.
+
2018-05-31 Maciej W. Rozycki <macro@mips.com>
* gdb.texinfo (Choosing Target Byte Order): Document endianness
Certain commands to @value{GDBN} may produce large amounts of
information output to the screen. To help you read all of it,
@value{GDBN} pauses and asks you for input at the end of each page of
-output. Type @key{RET} when you want to continue the output, or @kbd{q}
-to discard the remaining output. Also, the screen width setting
-determines when to wrap lines of output. Depending on what is being
-printed, @value{GDBN} tries to break the line at a readable place,
-rather than simply letting it overflow onto the following line.
+output. Type @key{RET} when you want to see one more page of output,
+@kbd{q} to discard the remaining output, or @kbd{c} to continue
+without paging for the rest of the current command. Also, the screen
+width setting determines when to wrap lines of output. Depending on
+what is being printed, @value{GDBN} tries to break the line at a
+readable place, rather than simply letting it overflow onto the
+following line.
Normally @value{GDBN} knows the size of the screen from the terminal
driver software. For example, on Unix @value{GDBN} uses the termcap data base
+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.
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"
}
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
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
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
}
}
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
}
}
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
}
}
}
# 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/
/* Current count of lines printed on this page, chars on this line. */
static unsigned int lines_printed, chars_printed;
+/* True if pagination is disabled for just one command. */
+
+static bool pagination_disabled_for_command;
+
/* Buffer and start column of buffered text, for doing smarter word-
wrapping. When someone calls wrap_here(), we start buffering output
that comes through fputs_filtered(). If we see a newline, we just
prompt_for_continue_wait_time. */
using namespace std::chrono;
steady_clock::time_point prompt_started = steady_clock::now ();
+ bool disable_pagination = pagination_disabled_for_command;
if (annotation_level > 1)
printf_unfiltered (("\n\032\032pre-prompt-for-continue\n"));
strcpy (cont_prompt,
- "---Type <return> to continue, or q <return> to quit---");
+ "--Type <RET> for more, q to quit, "
+ "c to continue without paging--");
if (annotation_level > 1)
strcat (cont_prompt, "\n\032\032prompt-for-continue\n");
if (p[0] == 'q')
/* Do not call quit here; there is no possibility of SIGINT. */
throw_quit ("Quit");
+ if (p[0] == 'c')
+ disable_pagination = true;
}
/* Now we have to do this again, so that GDB will know that it doesn't
need to save the ---Type <return>--- line at the top of the screen. */
reinitialize_more_filter ();
+ pagination_disabled_for_command = disable_pagination;
dont_repeat (); /* Forget prev cmd -- CR won't repeat it. */
}
{
lines_printed = 0;
chars_printed = 0;
+ pagination_disabled_for_command = false;
}
/* Indicate that if the next sequence of characters overflows the line,
/* Don't do any filtering if it is disabled. */
if (stream != gdb_stdout
|| !pagination_enabled
+ || pagination_disabled_for_command
|| batch_flag
|| (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX)
|| top_level_interpreter () == NULL
lineptr = linebuffer;
while (*lineptr)
{
- /* Possible new page. */
- if (filter && (lines_printed >= lines_per_page - 1))
+ /* Possible new page. Note that PAGINATION_DISABLED_FOR_COMMAND
+ might be set during this loop, so we must continue to check
+ it here. */
+ if (filter && (lines_printed >= lines_per_page - 1)
+ && !pagination_disabled_for_command)
prompt_for_continue ();
while (*lineptr && *lineptr != '\n')
if (wrap_column)
fputc_unfiltered ('\n', stream);
- /* Possible new page. */
- if (lines_printed >= lines_per_page - 1)
+ /* Possible new page. Note that
+ PAGINATION_DISABLED_FOR_COMMAND might be set during
+ this loop, so we must continue to check it here. */
+ if (lines_printed >= lines_per_page - 1
+ && !pagination_disabled_for_command)
prompt_for_continue ();
/* Now output indentation and wrapped string. */