aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.tui/list.exp
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-12-22 23:45:31 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-01-05 21:49:05 +0000
commitf2302a34f273611ead5e700e6d9e50e8dfe027f8 (patch)
treec5e7ede305c65d95e8cc3057c6a45e18c96dd529 /gdb/testsuite/gdb.tui/list.exp
parent6a5206eb2740e769bcb0500bdbc5998801d90ef6 (diff)
downloadgdb-f2302a34f273611ead5e700e6d9e50e8dfe027f8.zip
gdb-f2302a34f273611ead5e700e6d9e50e8dfe027f8.tar.gz
gdb-f2302a34f273611ead5e700e6d9e50e8dfe027f8.tar.bz2
gdb: use tui_set_layout not show_layout to fix window focus
When calling tui_add_win_to_layout, use tui_set_layout not show_layout so that window focus is correctly updated. If the focus is not correctly maintained then GDB can be crashed like this: start tui enable layout asm list SOME_FUNCTION At this point GDB will have "popped up" the source window to display SOME_FUNCTION. Previously no window would have focus at this point, and so if the user now does 'focus next' or 'focus prev', then GDB would crash. Calling tui_set_layout ensures that focus is correctly calculated as the source window is "popped up", and this fixes the issue. gdb/ChangeLog: * tui/tui-layout.c (tui_add_win_to_layout): Use tui_set_layout not show_layout. gdb/testsuite/ChangeLog: * gdb.tui/list.exp: Test 'focus next' after 'list main'. Change-Id: Id0b13f99b0e889261efedfd0adabe82020202f44
Diffstat (limited to 'gdb/testsuite/gdb.tui/list.exp')
-rw-r--r--gdb/testsuite/gdb.tui/list.exp3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.tui/list.exp b/gdb/testsuite/gdb.tui/list.exp
index a4a9fda..41cec12 100644
--- a/gdb/testsuite/gdb.tui/list.exp
+++ b/gdb/testsuite/gdb.tui/list.exp
@@ -35,3 +35,6 @@ Term::check_contents "asm window shows main" "$hex <main>"
Term::command "list main"
Term::check_contents "list main" "21 *return 0"
+# The following 'focus next' must be immediately after 'list main' to
+# ensure that GDB has a valid idea of what is currently focused.
+Term::command "focus next"