From patchwork Sun Apr 26 15:08:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 6454 Received: (qmail 34680 invoked by alias); 26 Apr 2015 15:09:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 34666 invoked by uid 89); 26 Apr 2015 15:09:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_05, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-qg0-f47.google.com Received: from mail-qg0-f47.google.com (HELO mail-qg0-f47.google.com) (209.85.192.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 26 Apr 2015 15:09:00 +0000 Received: by qgfi89 with SMTP id i89so40928925qgf.1 for ; Sun, 26 Apr 2015 08:08:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aJ1WuVHFQbadBCM6ccpcNjxZ6kpiJiX44RF+glId+lA=; b=F0AN6LkB7Nm3PlzOu4j2ExxJhz9sqZDWswLEG5/1m0o+72Ca0V5ZZdC7DXl80iTzYf ljrO2dcFuA6+VPxSO2tqtJqicmfJUkB8cx8NEEfWkLYiUSGjhs47DcxdmTuya0wpFpAC mzv/EulmCFYH6Ku4cV70tfbfUSaKTnMCFWoiuTSzOov0kmSZOaOPpRYY7xAHpYY1uVsG Q+tU1beQESj4y6MZdvWFNBEfb5vXHS1aebJpxaKTNJsujmPWCKy13uCZ7fGgxb0Y98sm x92Z26KJ03Q/WiafAIEQK+SfpGxdNvZBdOm6B7P1FJfuYWWrdbNPif9KkEMx3VJdlZ7+ 6sfw== X-Gm-Message-State: ALoCoQn4rjVMOLqL0dU0frY0ZKmVDkhYNj41T43Gpq21vqUZH9xH4NHzU+AJn09i94xMUQOXd/oo X-Received: by 10.140.93.54 with SMTP id c51mr4892095qge.47.1430060937757; Sun, 26 Apr 2015 08:08:57 -0700 (PDT) Received: from localhost.localdomain (ool-4353acd8.dyn.optonline.net. [67.83.172.216]) by mx.google.com with ESMTPSA id n16sm10529755qhb.12.2015.04.26.08.08.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 Apr 2015 08:08:56 -0700 (PDT) From: Patrick Palka To: gdb-patches@sourceware.org Cc: Patrick Palka Subject: [PATCH] Fix PR gdb/18155 Date: Sun, 26 Apr 2015 11:08:49 -0400 Message-Id: <1430060929-13968-1-git-send-email-patrick@parcs.ath.cx> 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. --- gdb/tui/tui-data.c | 7 ------- 1 file changed, 7 deletions(-) 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);