This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix PR gdb/18155
- From: Pedro Alves <palves at redhat dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>, gdb-patches at sourceware dot org
- Date: Mon, 27 Apr 2015 18:45:12 +0100
- Subject: Re: [PATCH] Fix PR gdb/18155
- Authentication-results: sourceware.org; auth=none
- References: <1430060929-13968-1-git-send-email-patrick at parcs dot ath dot cx>
On 04/26/2015 04:08 PM, Patrick Palka wrote:
> 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:
>
> * tui/tui-data.c (tui_free_window): Don't free the locator
> window when passed an SRC_WIN or a DISASSEM_WIN.
OK.
Thanks,
Pedro Alves