Commit Graph

6 Commits

Author SHA1 Message Date
Sandra Loosemore 581bea2c99 Fix TUI support checks in gdb.tui tests.
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-17 21:57:16 -07:00
Tom de Vries 8c74a764f2 [gdb/testsuite] Don't leak tuiterm.exp spawn override
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-06-12 13:29:43 +02:00
Tom Tromey 4f13c1c00b Make "file" clear TUI source window
I noticed that a plain "file" will leave the current source file in
the TUI source window.  Instead, I think, it should clear the source
window.  This patch implements this.

gdb/ChangeLog
2020-01-19  Tom Tromey  <tom@tromey.com>

	* tui/tui-winsource.c (tui_update_source_windows_with_line):
	Handle case where symtab is null.

gdb/testsuite/ChangeLog
2020-01-19  Tom Tromey  <tom@tromey.com>

	* gdb.tui/main.exp: Add check for plain "file".

Change-Id: I8424acf837f1a47f75bc6a833d1e917d4c10b51e
2020-01-19 13:08:48 -07:00
Joel Brobecker b811d2c292 Update copyright year range in all GDB files.
gdb/ChangeLog:

        Update copyright year range in all GDB files.
2020-01-01 10:20:53 +04:00
Tom Tromey 873de05c85 Fix TUI test suite regexps
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-11 19:19:13 -07:00
Tom Tromey 52b75bf1dc Add test that "file" shows "main"
This adds a new test that checks that the "file" command will show the
program's "main".

gdb/testsuite/ChangeLog
2019-07-27  Tom Tromey  <tom@tromey.com>

	* gdb.tui/main.exp: New file.
2019-07-27 21:08:36 -06:00