aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPatrick Palka <patrick@parcs.ath.cx>2015-04-25 21:59:02 -0400
committerPatrick Palka <patrick@parcs.ath.cx>2015-04-27 21:19:58 -0400
commit9720679936fc4f710d718f13d903c7826e048a36 (patch)
tree2e8b8e438686f73b9c3820fd922406ec45968737 /gdb
parent63ed81829ea8819bc96b288f95230876b0060b14 (diff)
downloadgdb-9720679936fc4f710d718f13d903c7826e048a36.zip
gdb-9720679936fc4f710d718f13d903c7826e048a36.tar.gz
gdb-9720679936fc4f710d718f13d903c7826e048a36.tar.bz2
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/tui/tui-data.c7
2 files changed, 6 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 44af045..1ff7a75 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2015-04-28 Patrick Palka <patrick@parcs.ath.cx>
+ 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.
+
+2015-04-28 Patrick Palka <patrick@parcs.ath.cx>
+
* tui/tui-data.h (struct tui_win_element): Forward-declare.
(tui_win_content): Move declaration.
(struct tui_gen_win_info): Give 'content' field the
diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c
index 44c1feb..ffd80d5 100644
--- a/gdb/tui/tui-data.c
+++ b/gdb/tui/tui-data.c
@@ -719,13 +719,6 @@ tui_free_window (struct tui_win_info *win_info)
{
case SRC_WIN:
case DISASSEM_WIN:
- generic_win = tui_locator_win_info_ptr ();
- if (generic_win != (struct tui_gen_win_info *) NULL)
- {
- tui_delete_win (generic_win->handle);
- generic_win->handle = (WINDOW *) NULL;
- }
- tui_free_win_content (generic_win);
if (win_info->detail.source_info.fullname)
{
xfree (win_info->detail.source_info.fullname);