gdb: Fix scrolling in TUI
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.tui / basic.exp
index a005400163090b31fdeaa1f8f99053e2a1603d27..be822f8a9151baa0fa228c7914b0643083cb6108 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2019 Free Software Foundation, Inc.
+# Copyright 2019-2020 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -35,21 +35,28 @@ gdb_assert {![string match "No Source Available" $text]} \
 Term::command "list main"
 Term::check_contents "list main" "21 *return 0"
 
-# This check fails because the file name in the title overwrites the
-# box.
-setup_xfail *-*-*
-Term::check_box "source box" 3 0 77 15
+# Get the first source line.
+set line [Term::get_line 1]
+# Send an up arrow.
+send_gdb "\033\[A"
+# Wait for a redraw and check that the first line changed.
+if {[Term::wait_for [string_to_regexp $line]] \
+       && [Term::get_line 1] != $line\
+       && [Term::get_line 2] == $line} {
+    pass "scroll up"
+} else {
+    fail "scroll up"
+}
+
+Term::check_box "source box" 0 0 80 15
 
 Term::command "layout asm"
 Term::check_contents "asm window shows main" "$hex <main>"
 
-Term::check_box "asm box" 3 0 77 15
+Term::check_box "asm box" 0 0 80 15
 
 Term::command "layout split"
 Term::check_contents "split layout contents" "21 *return 0.*$hex <main>"
 
-# This check fails because the file name in the title overwrites the
-# box.
-setup_xfail *-*-*
-Term::check_box "source box in split layout" 3 0 77 8
-Term::check_box "asm box in split layout" 3 7 77 8
+Term::check_box "source box in split layout" 0 0 80 7
+Term::check_box "asm box in split layout" 0 6 80 9
This page took 0.044628 seconds and 4 git commands to generate.