public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Correctly initialize the TUI locator window
@ 2015-06-27  2:35 Patrick Palka
  2015-06-27  2:35 ` [PATCH 2/3] Be lazy about refreshing the windows in tui_show_frame_info (PR tui/13378) Patrick Palka
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Patrick Palka @ 2015-06-27  2:35 UTC (permalink / raw)
  To: gdb-patches; +Cc: Patrick Palka

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;
     }
 
-- 
2.5.0.rc0.5.g91e10c5.dirty

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2015-07-01 12:40 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-27  2:35 [PATCH 1/3] Correctly initialize the TUI locator window Patrick Palka
2015-06-27  2:35 ` [PATCH 2/3] Be lazy about refreshing the windows in tui_show_frame_info (PR tui/13378) Patrick Palka
2015-06-30  2:32   ` [PATCH] " Patrick Palka
2015-06-30 14:27     ` Pedro Alves
2015-06-30 14:45       ` Patrick Palka
2015-06-30 15:11         ` Pedro Alves
2015-06-30 15:15           ` Patrick Palka
2015-06-30 16:51           ` [PATCH 2/3] " Patrick Palka
2015-06-30 17:26             ` Pedro Alves
2015-06-27  2:35 ` [PATCH 3/3] Replace TUI's select_frame hook " Patrick Palka
2015-06-27  2:50   ` Patrick Palka
2015-06-30  9:32     ` Pedro Alves
2015-06-30 12:16       ` Patrick Palka
2015-06-30 12:37         ` Patrick Palka
2015-06-30 14:08           ` Pedro Alves
2015-06-30 14:54             ` Patrick Palka
2015-06-30 14:56               ` Patrick Palka
2015-06-30 15:12               ` Patrick Palka
2015-06-30 15:47                 ` Pedro Alves
2015-06-30 16:40                   ` Patrick Palka
2015-06-30 17:07                     ` Pedro Alves
2015-06-30 17:11                       ` Patrick Palka
2015-06-30 17:32                         ` Pedro Alves
2015-06-30 17:49                           ` Patrick Palka
2015-07-01 12:40                       ` Patrick Palka
2015-06-30 13:23         ` Pedro Alves
2015-06-30 14:03           ` Patrick Palka
2015-06-30  8:36 ` [PATCH 1/3] Correctly initialize the TUI locator window Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).