aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/tui/tui-hooks.c14
-rw-r--r--gdb/tui/tui-stack.c15
-rw-r--r--gdb/tui/tui-stack.h2
4 files changed, 33 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2dc32d8..7c3200a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+2015-07-01 Patrick Palka <patrick@parcs.ath.cx>
+
+ * tui/tui-hooks.c (tui_refresh_frame_and_register_information):
+ Update commentary. Always refresh the registers when frame
+ information has changed.
+ * tui/tui-stack.c (tui_show_frame_info): Update commentary.
+ Change return type to int. Return 1 if frame information has
+ changed, 0 otherwise.
+ (tui_before_prompt): Update commentary.
+ * tui/tui-stack.h (tui_show_frame_info): Change return type to
+ int.
+
2015-06-30 Patrick Palka <patrick@parcs.ath.cx>
PR tui/13378
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index 5987209..0eb2f07 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -122,7 +122,8 @@ tui_about_to_proceed (void)
/* Refresh TUI's frame and register information. This is a hook intended to be
used to update the screen after potential frame and register changes.
- REGISTERS_TOO_P controls whether to refresh our register information. */
+ REGISTERS_TOO_P controls whether to refresh our register information even
+ if frame information hasn't changed. */
static void
tui_refresh_frame_and_register_information (int registers_too_p)
@@ -130,6 +131,7 @@ tui_refresh_frame_and_register_information (int registers_too_p)
struct frame_info *fi;
CORE_ADDR pc;
struct cleanup *old_chain;
+ int frame_info_changed_p;
if (!has_stack_frames ())
return;
@@ -156,10 +158,11 @@ tui_refresh_frame_and_register_information (int registers_too_p)
/* Display the frame position (even if there is no symbols or the PC
is not known). */
- tui_show_frame_info (fi);
+ frame_info_changed_p = tui_show_frame_info (fi);
/* Refresh the register window if it's visible. */
- if (tui_is_window_visible (DATA_WIN) && registers_too_p)
+ if (tui_is_window_visible (DATA_WIN)
+ && (frame_info_changed_p || registers_too_p))
{
tui_refreshing_registers = 1;
tui_check_data_values (fi);
@@ -199,8 +202,9 @@ tui_before_prompt (const char *current_gdb_prompt)
{
/* This refresh is intended to catch changes to the selected frame following
a call to "up", "down" or "frame". As such we don't necessarily want to
- refresh registers here as they could not have changed. Registers will be
- refreshed after a normal stop or by our tui_register_changed_hook. */
+ refresh registers here unless the frame actually changed by one of these
+ commands. Registers will otherwise be refreshed after a normal stop or by
+ our tui_register_changed_hook. */
tui_refresh_frame_and_register_information (/*registers_too_p=*/0);
}
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index 65d18fe..e36f8bd 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -351,9 +351,12 @@ tui_update_locator_fullname (const char *fullname)
}
/* Function to print the frame information for the TUI. The windows are
- refreshed only if frame information has changed since the last refresh. */
+ refreshed only if frame information has changed since the last refresh.
-void
+ Return 1 if frame information has changed (and windows subsequently
+ refreshed), 0 otherwise. */
+
+int
tui_show_frame_info (struct frame_info *fi)
{
struct tui_win_info *win_info;
@@ -391,7 +394,7 @@ tui_show_frame_info (struct frame_info *fi)
not changed. If frame information has not changed, then the windows'
contents will not change. So don't bother refreshing the windows. */
if (!locator_changed_p)
- return;
+ return 0;
tui_show_locator_content ();
start_line = 0;
@@ -462,6 +465,8 @@ tui_show_frame_info (struct frame_info *fi)
}
tui_update_exec_info (win_info);
}
+
+ return 1;
}
else
{
@@ -469,7 +474,7 @@ tui_show_frame_info (struct frame_info *fi)
= tui_set_locator_info (NULL, NULL, NULL, 0, (CORE_ADDR) 0);
if (!locator_changed_p)
- return;
+ return 0;
tui_show_locator_content ();
for (i = 0; i < (tui_source_windows ())->count; i++)
@@ -478,6 +483,8 @@ tui_show_frame_info (struct frame_info *fi)
tui_clear_source_content (win_info, EMPTY_SOURCE_PROMPT);
tui_update_exec_info (win_info);
}
+
+ return 1;
}
}
diff --git a/gdb/tui/tui-stack.h b/gdb/tui/tui-stack.h
index 2a34f9e..b89ddc4 100644
--- a/gdb/tui/tui-stack.h
+++ b/gdb/tui/tui-stack.h
@@ -26,6 +26,6 @@ struct frame_info;
extern void tui_update_locator_fullname (const char *);
extern void tui_show_locator_content (void);
-extern void tui_show_frame_info (struct frame_info *);
+extern int tui_show_frame_info (struct frame_info *);
#endif