From patchwork Sat Jun 27 02:35:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 7405 Received: (qmail 39247 invoked by alias); 27 Jun 2015 02:35:55 -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 39183 invoked by uid 89); 27 Jun 2015 02:35:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL, BAYES_20, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-qk0-f176.google.com Received: from mail-qk0-f176.google.com (HELO mail-qk0-f176.google.com) (209.85.220.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 27 Jun 2015 02:35:49 +0000 Received: by qkei195 with SMTP id i195so26113829qke.3 for ; Fri, 26 Jun 2015 19:35:47 -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=6Yei9XGmO4R1wvIiZB6VaYQ8ROw/Wk8OuJVRFN/w15k=; b=Jljj0iaGi3IKkOnY39Ljf5Ay5Ko+Un22tRp8DKUeu7lOSS9yy7ci1FNbEQ28PjaVNU sl/eOHOmEIpWlmM2S41cYdm7BZ53U/LTpgjhVlZnVhu3jnzmrE7bVqMCf06ljNE3KHk9 Zt3Shx/SjrdPccPch3Bz21/INrgDEx/WLBj566kDmJ/QetPUtyjhofb6ltI2cBDHNxrK 6lvNJ6bXclv5on5/6lzubWKWPWLH535EI5F1Zao1WfpJgUTAHS8t67i+BbV/GOKu+N95 PNy4DkInYFN0+fwy6mRdXp0cJmLbv1z+7rrhBxghWlbiGSXM6Doo5MSwXD9Cxn8IuQqT 8LEQ== X-Gm-Message-State: ALoCoQmmZXzwkM4d4YcSiyPpu5xAjYNdG/y7O+4bgN7tFekr4Uggpov0e5S3Ul4tbtP8MwguU6nj X-Received: by 10.140.25.208 with SMTP id 74mr6276916qgt.104.1435372546927; Fri, 26 Jun 2015 19:35:46 -0700 (PDT) Received: from localhost.localdomain (ool-4353acd8.dyn.optonline.net. [67.83.172.216]) by mx.google.com with ESMTPSA id k205sm7892029qhk.39.2015.06.26.19.35.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Jun 2015 19:35:46 -0700 (PDT) From: Patrick Palka To: gdb-patches@sourceware.org Cc: Patrick Palka Subject: [PATCH 1/3] Correctly initialize the TUI locator window Date: Fri, 26 Jun 2015 22:35:23 -0400 Message-Id: <1435372525-1374-1-git-send-email-patrick@parcs.ath.cx> The call to tui_alloc_content in tui_set_locator_info passes locator->type as the type of the window whose content is being allocated. This may seem correct but it's actually not because when this code path actually get executed locator->type has not yet been to set LOCATOR_WIN so it defaults to 0 i.e. SRC_WIN. Thus we allocate the content of the locator window as if it was the source window. This oversight turns out not to be a big deal in practice but the patch that follows depends on the locator's proc_name and full_name arrays to be initialized to the empty string which is done by tui_alloc_content if we pass to it LOCATOR_WIN. This patch fixes this bug by explicitly passing LOCATOR_WIN to tui_alloc_content. gdb/ChangeLog: * tui/tui-stack.c (tui_set_locator_info): Explicitly pass LOCATOR_WIN to tui_alloc_content. --- gdb/tui/tui-stack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index 2870d70..b17d303 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -306,7 +306,7 @@ tui_set_locator_info (struct gdbarch *gdbarch, /* Allocate the locator content if necessary. */ if (locator->content_size <= 0) { - locator->content = tui_alloc_content (1, locator->type); + locator->content = tui_alloc_content (1, LOCATOR_WIN); locator->content_size = 1; }