aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/tui/tui-stack.c38
2 files changed, 23 insertions, 21 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a069b0a..8905a24 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2019-08-30 Tom Tromey <tom@tromey.com>
+ * tui/tui-stack.c (tui_show_locator_content): Move lower. Rewrite.
+ (tui_locator_window::rerender): Rewrite using body of previous
+ tui_show_locator_content.
+
+2019-08-30 Tom Tromey <tom@tromey.com>
+
* tui/tui-stack.h (struct tui_locator_window) <set_locator_info,
set_locator_fullname>: New methods.
* tui/tui-stack.c (tui_locator_window::set_locator_fullname):
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index a4adf36..48062fe 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -254,38 +254,27 @@ tui_get_function_from_frame (struct frame_info *fi)
}
void
-tui_show_locator_content (void)
+tui_locator_window::rerender ()
{
- char *string;
- struct tui_locator_window *locator;
-
- locator = tui_locator_win_info_ptr ();
-
- if (locator != NULL && locator->handle != NULL)
+ if (handle != NULL)
{
- string = tui_make_status_line (locator);
- wmove (locator->handle, 0, 0);
+ char *string = tui_make_status_line (this);
+ wmove (handle, 0, 0);
/* We ignore the return value from wstandout and wstandend, casting
them to void in order to avoid a compiler warning. The warning
itself was introduced by a patch to ncurses 5.7 dated 2009-08-29,
changing these macro to expand to code that causes the compiler
to generate an unused-value warning. */
- (void) wstandout (locator->handle);
- waddstr (locator->handle, string);
- wclrtoeol (locator->handle);
- (void) wstandend (locator->handle);
- locator->refresh_window ();
- wmove (locator->handle, 0, 0);
+ (void) wstandout (handle);
+ waddstr (handle, string);
+ wclrtoeol (handle);
+ (void) wstandend (handle);
+ refresh_window ();
+ wmove (handle, 0, 0);
xfree (string);
}
}
-void
-tui_locator_window::rerender ()
-{
- tui_show_locator_content ();
-}
-
/* See tui-stack.h. */
void
@@ -411,6 +400,13 @@ tui_show_frame_info (struct frame_info *fi)
}
}
+void
+tui_show_locator_content ()
+{
+ struct tui_locator_window *locator = tui_locator_win_info_ptr ();
+ locator->rerender ();
+}
+
/* Function to initialize gdb commands, for tui window stack
manipulation. */