aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/tui-window.exp
AgeCommit message (Collapse)AuthorFilesLines
2024-02-27Rewrite "python" command exception handlingTom Tromey1-1/+1
The "python" command (and the Python implementation of the gdb "source" command) does not handle Python exceptions in the same way as other gdb-facing Python code. In particular, exceptions are turned into a generic error rather than being routed through gdbpy_handle_exception, which takes care of converting to 'quit' as appropriate. I think this was done this way because PyRun_SimpleFile and friends do not propagate the Python exception -- they simply indicate that one occurred. This patch reimplements these functions to respect the general gdb convention here. As a bonus, some Windows-specific code can be removed, as can the _execute_file function. The bulk of this change is tweaking the test suite to match the new way that exceptions are displayed. These changes are largely uninteresting. However, it's worth pointing out the py-error.exp change. Here, the failure changes because the test changes the host charset to something that isn't supported by Python. This then results in a weird error in the new setup. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31354 Acked-By: Tom de Vries <tdevries@suse.de> Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2024-01-12Update copyright year range in header of all files managed by GDBAndrew Burgess1-1/+1
This commit is the result of the following actions: - Running gdb/copyright.py to update all of the copyright headers to include 2024, - Manually updating a few files the copyright.py script told me to update, these files had copyright headers embedded within the file, - Regenerating gdbsupport/Makefile.in to refresh it's copyright date, - Using grep to find other files that still mentioned 2023. If these files were updated last year from 2022 to 2023 then I've updated them this year to 2024. I'm sure I've probably missed some dates. Feel free to fix them up as you spot them.
2023-07-10Update TUI window title when changedTom Tromey1-0/+4
I wrote a TUI window in Python, and I noticed that setting its title did not result in a refresh, so the new title did not appear. This patch corrects this problem.
2023-03-13[gdb/testsuite] Fix gdb.python/tui-window.exp for remote hostTom de Vries1-0/+1
When running gdb.python/tui-window.exp with host board local-remote-host-notty and target board native-gdbserver, I get: ... UNSUPPORTED: gdb.python/tui-window.exp: TUI not supported FAIL: gdb.python/tui-window.exp: test title ... Fix this by adding the missing return after the unsupported. Tested on x86_64-linux.
2023-01-13Rename to allow_tui_testsTom Tromey1-4/+1
This changes skip_tui_tests to invert the sense, and renames it to allow_tui_tests. It also rewrites this function to use the output of "gdb --configuration", and it adds a note about the state of the TUI to that output.
2023-01-13Rename to allow_python_testsTom Tromey1-1/+1
This changes skip_python_tests to invert the sense, and renames it to allow_python_tests.
2023-01-13Use "require" for Python testsTom Tromey1-3/+1
This changes various tests to use "require" for the Python feature.
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker1-1/+1
This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker1-1/+1
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-07-14[gdb/testsuite] Add missing skip_tui_testsTom de Vries1-0/+5
When building gdb with --disable-tui, we run into: ... (gdb) frame apply all -- -^M Undefined command: "-". Try "help".^M (gdb) ERROR: Undefined command "frame apply all -- -". UNRESOLVED: gdb.base/options.exp: test-frame-apply: frame apply all -- - ... Fix this by detecting whether tui is supported, and skipping the tui-related tests otherwise. Same in some gdb.tui test-cases. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-07-13 Tom de Vries <tdevries@suse.de> * gdb.base/options.exp: Skip tui-related tests when tui is not supported. * gdb.python/tui-window-disabled.exp: Same. * gdb.python/tui-window.exp: Same.
2021-02-08gdb/python: don't allow the user to delete window title attributesAndrew Burgess1-0/+6
There's a bug in the python tui API. If the user tries to delete the window title attribute then this will trigger undefined behaviour in GDB due to a missing nullptr check. gdb/ChangeLog: * python/py-tui.c (gdbpy_tui_set_title): Check that the new value for the title is not nullptr. gdb/testsuite/ChangeLog: * gdb.python/tui-window.exp: Add new tests. * gdb.python/tui-window.py (TestWindow) <__init__>: Store TestWindow object into global the_window. <remote_title>: New method. (delete_window_title): New function.
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-06-16Fix crash when TUI window creation failsTom Tromey1-0/+3
If a TUI window is written in Python, and if the window construction function fails, then gdb will crash. This patch fixes the crash. gdb/ChangeLog 2020-06-16 Tom Tromey <tom@tromey.com> * python/py-tui.c (tui_py_window::~tui_py_window): Handle case where m_window==nullptr. gdb/testsuite/ChangeLog 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-12[gdb/testsuite] Don't leak tuiterm.exp spawn overrideTom de Vries1-1/+1
In lib/tuiterm.exp the builtin spawn is overridden by a tui-specific version. After running the first test-case that imports tuiterm.exp, the override remains active, so it can cause trouble in subsequent test-cases, even if they do not import tuiterm.exp. See f.i. commit c8d4f6dfd9 "[gdb/testsuite] Fix spawn in tuiterm.exp". Fix this by: - adding a variable gdb_finish_hooks which is a list of procs to run during gdb_finish - adding a proc tuiterm_env that is used in test-cases instead of "load_lib tuiterm.exp". - letting tuiterm_env: - install the tui-specific spawn version, and - use the gdb_finish_hooks to schedule restoring the builtin spawn version. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-06-12 Tom de Vries <tdevries@suse.de> * lib/tuiterm.exp (spawn): Rename to ... (tui_spawn): ... this. (toplevel): Move rename of spawn ... (gdb_init_tuiterm): ... here. New proc. (gdb_finish_tuiterm): New proc. * lib/gdb.exp (gdb_finish_hooks): New global var. (gdb_finish): Handle gdb_finish_hooks. (tuiterm_env): New proc. * gdb.python/tui-window.exp: Replace load_lib tuiterm.exp with tuiterm_env. * gdb.tui/basic.exp: Same. * gdb.tui/corefile-run.exp: Same. * gdb.tui/empty.exp: Same. * gdb.tui/list-before.exp: Same. * gdb.tui/list.exp: Same. * gdb.tui/main.exp: Same. * gdb.tui/new-layout.exp: Same. * gdb.tui/regs.exp: Same. * gdb.tui/resize.exp: Same. * gdb.tui/tui-layout-asm-short-prog.exp: Same. * gdb.tui/tui-layout-asm.exp: Same. * gdb.tui/tui-missing-src.exp: Same. * gdb.tui/winheight.exp: Same.
2020-02-22Allow TUI windows in PythonTom Tromey1-0/+51
This patch adds support for writing new TUI windows in Python. 2020-02-22 Tom Tromey <tom@tromey.com> * NEWS: Add entry for gdb.register_window_type. * tui/tui-layout.h (window_factory): New typedef. (tui_register_window): Declare. * tui/tui-layout.c (saved_tui_windows): New global. (tui_apply_current_layout): Use it. (tui_register_window): New function. * python/python.c (do_start_initialization): Call gdbpy_initialize_tui. (python_GdbMethods): Add "register_window_type" function. * python/python-internal.h (gdbpy_register_tui_window) (gdbpy_initialize_tui): Declare. * python/py-tui.c: New file. * Makefile.in (SUBDIR_PYTHON_SRCS): Add py-tui.c. gdb/doc/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * python.texi (Python API): Add menu item. (TUI Windows In Python): New node. gdb/testsuite/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * gdb.python/tui-window.exp: New file. * gdb.python/tui-window.py: New file. Change-Id: I85fbfb923a1840450a00a7dce113a05d7f048baa