Fix PR gdb/18155
authorPatrick Palka <patrick@parcs.ath.cx>
Sun, 26 Apr 2015 01:59:02 +0000 (21:59 -0400)
committerPatrick Palka <patrick@parcs.ath.cx>
Tue, 28 Apr 2015 01:19:58 +0000 (21:19 -0400)
commit9720679936fc4f710d718f13d903c7826e048a36
tree2e8b8e438686f73b9c3820fd922406ec45968737
parent63ed81829ea8819bc96b288f95230876b0060b14
Fix PR gdb/18155

For no good reason the function tui_free_window() is freeing the locator
window when we pass it an SRC_WIN or a DISASSEM_WIN.  This behavior
doesn't make much sense because the locator window is always visible and
its contents do not change when the main window changes.

This behavior triggers the above PR because when we switch from one TUI
window to another (in the PR, from the src window to the asm window) we
call tui_free_window() on the previously active window (in the PR, the
src window).  The function then frees the src window along with the
locator window and later we segfault when the now-active asm window
tries to query the locator window about the inferior's PC.

This patch fixes this apparently wrong behavior by changing
tui_free_window() to not free the locator window when we pass it an
SRC_WIN or a DISASSEM_WIN.

gdb/ChangeLog:

PR gdb/18155
* tui/tui-data.c (tui_free_window): Don't free the locator
window when passed an SRC_WIN or a DISASSEM_WIN.
gdb/ChangeLog
gdb/tui/tui-data.c