diff options
author | Pedro Alves <palves@redhat.com> | 2019-02-27 18:48:36 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2019-02-27 18:48:36 +0000 |
commit | 8ed252144a29fb6370b828d84419d5c59d23dae2 (patch) | |
tree | 6cc5175c56e095ab018901fa82622fa42fc88814 /gdb/testsuite/gdb.base | |
parent | 23031e319207140e76a9c18e308995fe28322b58 (diff) | |
download | gdb-8ed252144a29fb6370b828d84419d5c59d23dae2.zip gdb-8ed252144a29fb6370b828d84419d5c59d23dae2.tar.gz gdb-8ed252144a29fb6370b828d84419d5c59d23dae2.tar.bz2 |
Make 'show width/height' display "unlimited" when capped for readline
When we cap the height/width sizes before passing to readline, tweak
the corresponding command variable to show "unlimited":
(gdb) set height 0x8000
(gdb) show height
Number of lines gdb thinks are in a page is unlimited.
Instead of the current output:
(gdb) set height 0x8000
(gdb) show height
Number of lines gdb thinks are in a page is 32768.
gdb/ChangeLog:
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":
gdb/testsuite/ChangeLog:
2019-02-27 Pedro Alves <palves@redhat.com>
* gdb.base/page.exp: Add tests for "set/show width/height" with
"infinite" values.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r-- | gdb/testsuite/gdb.base/page.exp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/page.exp b/gdb/testsuite/gdb.base/page.exp index 10ebf0d..8f1698c 100644 --- a/gdb/testsuite/gdb.base/page.exp +++ b/gdb/testsuite/gdb.base/page.exp @@ -94,6 +94,30 @@ gdb_expect_list "paged count for interrupt" \ 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 |