diff options
author | Tom de Vries <tdevries@suse.de> | 2023-12-04 08:48:48 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-12-04 08:48:48 +0100 |
commit | d1a912db7fdf50c28224d20464bfa163d8438980 (patch) | |
tree | b17d70bbfa6bf7f7086c81a5dbdccd4bd7312dce /gdb/testsuite/lib/tuiterm.exp | |
parent | 6497a01d1d38ca033188702068f38cf6dad75d84 (diff) | |
download | gdb-d1a912db7fdf50c28224d20464bfa163d8438980.zip gdb-d1a912db7fdf50c28224d20464bfa163d8438980.tar.gz gdb-d1a912db7fdf50c28224d20464bfa163d8438980.tar.bz2 |
[gdb/tui] Fix wrapping strings
I noticed that after resizing to a narrow window, I got:
...
┌────────────────┐
│ │
│[ No Source Avail
able ] │
│ │
└────────────────┘
...
Fix this by adding two new functions:
- tui_win_info::display_string (int y, int x, const char *str)
- tui_win_info::display_string (const char *str)
that make sure that borders are not overwritten, which get us instead:
...
┌────────────────┐
│ │
│[ No Source Avai│
│ │
│ │
└────────────────┘
...
Tested on x86_64-linux.
Diffstat (limited to 'gdb/testsuite/lib/tuiterm.exp')
-rw-r--r-- | gdb/testsuite/lib/tuiterm.exp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index 854fde5..e668fe2 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -1102,6 +1102,21 @@ namespace eval Term { } } + # Wait until a box appears at the given coordinates. + proc wait_for_box {test_name x y width height} { + while 1 { + if { [accept_gdb_output] == 0 } { + return 0 + } + + set why [_check_box $x $y $width $height] + if {$why == ""} { + pass $test_name + break + } + } + } + # Check whether the text contents of the terminal match the # regular expression. Note that text styling is not considered. proc check_contents {test_name regexp} { |