This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Correctly initialize the TUI locator window
- From: Patrick Palka <ppalka at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 30 Jun 2015 17:58:23 -0000
- Subject: [binutils-gdb] Correctly initialize the TUI locator window
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c45613e33dbdc646b6fd7f02f86635639e852bfb
commit c45613e33dbdc646b6fd7f02f86635639e852bfb
Author: Patrick Palka <patrick@parcs.ath.cx>
Date: Fri Jun 26 20:17:56 2015 -0400
Correctly initialize the TUI locator window
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.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/tui/tui-stack.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8a961c6..5d5e829 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-30 Patrick Palka <patrick@parcs.ath.cx>
+
+ * tui/tui-stack.c (tui_set_locator_info): Explicitly pass
+ LOCATOR_WIN to tui_alloc_content.
+
2015-06-30 Yao Qi <yao.qi@linaro.org>
PR tdep/18605
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;
}