+2019-02-27 Pedro Alves <palves@redhat.com>
+
+ * utils.c (set_screen_size): When we cap the height/width sizes,
+ tweak the corresponding command variable to show "unlimited":
+
2019-02-27 Saagar Jha <saagar@saagarjha.com>
Pedro Alves <palves@redhat.com>
+2019-02-27 Pedro Alves <palves@redhat.com>
+
+ * gdb.base/page.exp: Add tests for "set/show width/height" with
+ "infinite" values.
+
2019-02-27 Tom Tromey <tromey@adacore.com>
* lib/gdb.exp (skip_python_tests_prompt): Don't check for Python
gdb_test "q" "Quit" "quit while paging"
+# Check that width/height of sqrt(INT_MAX) is treated as unlimited, as
+# well as "0" and explicit "unlimited".
+foreach_with_prefix size {"0" "0x80000000" "unlimited"} {
+
+ # Alternate between "non-unlimited" values and "unlimited" values,
+ # to make sure we're not seeing stale internal state.
+
+ gdb_test "set width 200"
+ gdb_test "show width" \
+ "Number of characters gdb thinks are in a line is 200\\."
+
+ gdb_test "set height 200"
+ gdb_test "show height" \
+ "Number of lines gdb thinks are in a page is 200\\."
+
+ gdb_test "set width $size"
+ gdb_test "show width unlimited" \
+ "Number of characters gdb thinks are in a line is unlimited\\."
+
+ gdb_test "set height $size"
+ gdb_test "show height unlimited" \
+ "Number of lines gdb thinks are in a page is unlimited\\."
+}
+
gdb_exit
return 0
const int sqrt_int_max = INT_MAX >> (sizeof (int) * 8 / 2);
if (rows <= 0 || rows > sqrt_int_max)
- rows = sqrt_int_max;
+ {
+ rows = sqrt_int_max;
+ lines_per_page = UINT_MAX;
+ }
if (cols <= 0 || cols > sqrt_int_max)
- cols = sqrt_int_max;
+ {
+ cols = sqrt_int_max;
+ chars_per_line = UINT_MAX;
+ }
/* Update Readline's idea of the terminal size. */
rl_set_screen_size (rows, cols);