]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/tui] Remove stale title when showing "No Source Available"
authorTom de Vries <tdevries@suse.de>
Tue, 4 Feb 2025 09:21:28 +0000 (10:21 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 4 Feb 2025 09:21:28 +0000 (10:21 +0100)
commit9cc62187b4bcc5ddac456043f55542484f6fada3
tree5d71801f32deb36b41d59a41e083ec8e373d66eb
parentbc61d5916a04605079723f6674bd33d2a923af2e
[gdb/tui] Remove stale title when showing "No Source Available"

When running test-case gdb.tui/main.exp, the last command discards the
executable file and symbol table:
...
(gdb) file
No executable file now.
Discard symbol table from `main'? (y or n) [answered Y; input not from terminal]
No symbol file now.
(gdb)
...
and we end up with this source window:
...
+-tui-layout.c----------------------------------------------------------------+
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                           [ No Source Available ]                           |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
+-----------------------------------------------------------------------------+
...

The source window title shouldn't be showing tui-layout.c.  It's the source
file containing function main for the executable that was just discarded.

Fix this by clearing the title in tui_source_window::erase_source_content.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.tui/main.exp
gdb/tui/tui-source.h