aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.tui/resize.exp
AgeCommit message (Collapse)AuthorFilesLines
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-11-22[gdb/tui] Fix resizing of terminal to 1 or 2 linesTom de Vries1-0/+9
When starting TUI in a terminal with 3 lines: ... $ echo $LINES 3 $ gdb -q -tui ... and resizing the terminal to 2 lines we run into a segfault. The problem is that for the source window: - the minimum height is 3 (the default), but - the maximum height is only 2 because there are only 2 lines. This discrepancy eventually leads to a call to newwin in make_window with: ... (gdb) p height $1 = 3 (gdb) p width $2 = 56 (gdb) p y $3 = -1 (gdb) p x $4 = 0 ... which results in a nullptr. This violates the assumption here in tui_apply_current_layout: .... /* Get the new list of currently visible windows. */ std::vector<tui_win_info *> new_tui_windows; applied_layout->get_windows (&new_tui_windows); ... that get_windows only returns visible windows, which leads to tui_windows holding a dangling pointer, which results in the segfault. Fix this by: - making sure get_windows only returns visible windows, and - detecting the situation and dropping windows from the layout if there's no room for them. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com> PR tui/31044 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31044
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-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-17Fix TUI support checks in gdb.tui tests.Sandra Loosemore1-0/+1
2020-06-17 Sandra Loosemore <sandra@codesourcery.com> gdb/testsuite/ * gdb.tui/basic.exp: Skip test when TUI is unsupported, don't just say UNSUPPORTED. * gdb.tui/corefile-run.exp: Likewise. * gdb.tui/empty.exp: Likewise. * gdb.tui/list-before.exp: Likewise. * gdb.tui/list.exp: Likewise. * gdb.tui/main.exp: Likewise. * gdb.tui/regs.exp: Likewise. * gdb.tui/resize.exp: Likewise. * gdb.tui/tui-layout-asm-short-prog.exp: Likewise. * gdb.tui/tui-layout-asm.exp: Likewise. * gdb.tui/tui-missing-src.exp: Likewise. * gdb.tui/winheight.exp: Likewise. * gdb.tui/new-layout.exp: Likewise. Also move check earlier.
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-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-12-11Fix TUI test suite regexpsTom Tromey1-1/+1
Testing on another TUI series showed that some of the regexps in the TUI test suite have been incorrect for a while. In particular, "|" was meant literally in these tests, but was interpreted as pattern alternation due to lack of quoting. This patch fixes the bad tests. I am checking this in. gdb/testsuite/ChangeLog 2019-12-11 Tom Tromey <tom@tromey.com> * gdb.tui/resize.exp: Fix regexp. * gdb.tui/regs.exp: Fix regexps. * gdb.tui/main.exp: Fix regexp. Change-Id: Ib6661361171ac120bb92f4a8aec7efa4bcaa36b9
2019-12-11Re-apply the current layout when resizingTom Tromey1-1/+1
The TUI has separate code for each possible layout to handle the case where the terminal window is resized. With the new layout code, this can all be replaced with a call to tui_apply_current_layout, which simply re-applies the current layout. This results in some small differences in behavior when resizing, so some tests are updated. gdb/ChangeLog 2019-12-11 Tom Tromey <tom@tromey.com> * tui/tui-win.c (tui_resize_all): Remove code, call tui_apply_current_layout. gdb/testsuite/ChangeLog 2019-12-11 Tom Tromey <tom@tromey.com> * gdb.tui/resize.exp: Update. * gdb.tui/empty.exp (layouts): Update. Change-Id: I3dc6c02a753d495d9ab5e8213d550a147198ce6f
2019-09-08Truncate long TUI window titlesTom Tromey1-2/+0
If a TUI window has a long title, it can overflow the title line. This changes the TUI to use just the tail part of the title in this case. gdb/ChangeLog 2019-09-08 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (box_win): Truncate long window titles. gdb/testsuite/ChangeLog 2019-09-08 Tom Tromey <tom@tromey.com> * gdb.tui/resize.exp: Remove setup_xfail. * gdb.tui/regs.exp: Remove setup_xfail. * gdb.tui/basic.exp: Remove setup_xfail.
2019-07-27Add TUI resizing testTom Tromey1-0/+42
This adds a test case that resizes the terminal and then checks that the TUI updates properly. gdb/testsuite/ChangeLog 2019-07-27 Tom Tromey <tom@tromey.com> * lib/tuiterm.exp (spawn): New proc. (Term::resize): New proc. * gdb.tui/resize.exp: New file.