From f2302a34f273611ead5e700e6d9e50e8dfe027f8 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Sun, 22 Dec 2019 23:45:31 +0000 Subject: 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 --- gdb/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/ChangeLog') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 735333f..c24dcca 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-01-05 Andrew Burgess + + * tui/tui-layout.c (tui_add_win_to_layout): Use tui_set_layout not + show_layout. + 2020-01-05 Luis Machado * aarch64-linux-nat.c -- cgit v1.1