aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-tui.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c
index 22f4b0f..97e9de7 100644
--- a/gdb/python/py-tui.c
+++ b/gdb/python/py-tui.c
@@ -111,8 +111,9 @@ public:
}
}
- /* Write STR to the window. */
- void output (const char *str);
+ /* Write STR to the window. FULL_WINDOW is true to erase the window
+ contents beforehand. */
+ void output (const char *str, bool full_window);
/* A helper function to compute the viewport width. */
int viewport_width () const
@@ -229,12 +230,18 @@ tui_py_window::do_scroll_vertical (int num_to_scroll)
}
void
-tui_py_window::output (const char *text)
+tui_py_window::output (const char *text, bool full_window)
{
if (m_inner_window != nullptr)
{
+ if (full_window)
+ werase (m_inner_window.get ());
+
tui_puts (text, m_inner_window.get ());
- tui_wrefresh (m_inner_window.get ());
+ if (full_window)
+ check_and_display_highlight_if_needed ();
+ else
+ tui_wrefresh (m_inner_window.get ());
}
}
@@ -405,13 +412,14 @@ gdbpy_tui_write (PyObject *self, PyObject *args)
{
gdbpy_tui_window *win = (gdbpy_tui_window *) self;
const char *text;
+ int full_window = 0;
- if (!PyArg_ParseTuple (args, "s", &text))
+ if (!PyArg_ParseTuple (args, "s|i", &text, &full_window))
return nullptr;
REQUIRE_WINDOW (win);
- win->window->output (text);
+ win->window->output (text, full_window);
Py_RETURN_NONE;
}