+2020-06-16 Tom Tromey <tom@tromey.com>
+
+ * python/py-tui.c (tui_py_window::~tui_py_window): Handle case
+ where m_window==nullptr.
+
2020-06-15 Tom Tromey <tromey@adacore.com>
* windows-nat.c (windows_nat::handle_output_debug_string):
{
gdbpy_enter enter_py (get_current_arch (), current_language);
- if (PyObject_HasAttrString (m_window.get (), "close"))
+ /* This can be null if the user-provided Python construction
+ function failed. */
+ if (m_window != nullptr
+ && PyObject_HasAttrString (m_window.get (), "close"))
{
gdbpy_ref<> result (PyObject_CallMethod (m_window.get (), "close",
nullptr));
+2020-06-16 Tom Tromey <tom@tromey.com>
+
+ * gdb.python/tui-window.py (failwin): New function. Register it
+ as a TUI window type.
+ * gdb.python/tui-window.exp: Create new "fail" layout. Test it.
+
2020-06-16 Gary Benson <gbenson@redhat.com>
* gdb.python/py-nested-maps.c (create_map): Add missing return
"source ${testfile}.py"
gdb_test_no_output "tui new-layout test test 1 status 0 cmd 1"
+gdb_test_no_output "tui new-layout fail fail 1 status 0 cmd 1"
if {![Term::enter_tui]} {
unsupported "TUI not supported"
Term::resize 51 51
# Remember that a resize request actually does two resizes...
Term::check_contents "Window was updated" "Test: 2"
+
+Term::command "layout fail"
self.count = self.count + 1
gdb.register_window_type("test", TestWindow)
+
+# A TUI window "constructor" that always fails.
+def failwin(win):
+ raise RuntimeError("Whoops")
+
+gdb.register_window_type("fail", failwin)