diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-12-22 16:26:37 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2023-01-27 16:20:10 +0000 |
commit | 58c6d2ac109965f8e38908146448073ab1152e81 (patch) | |
tree | e44d8db7943145c103ea22e96f2418d41dab4163 /config.rpath | |
parent | efe1b6507b7e6ae5ee45af5b1568b910a3170750 (diff) | |
download | gdb-58c6d2ac109965f8e38908146448073ab1152e81.zip gdb-58c6d2ac109965f8e38908146448073ab1152e81.tar.gz gdb-58c6d2ac109965f8e38908146448073ab1152e81.tar.bz2 |
gdb/tui: improve errors from tui focus command
This commit improves (I think) the errors from the tui focus command.
There are a number of errors that can be triggered by the focus
command, they include:
(1) Window name "NAME" is ambiguous
(2) Unrecognized window name "NAME"
(3) Window "NAME" cannot be focused
Error (1) is triggered when the user gives a partial window name, and
the name matches multiple windows in the current layout.
It is worth noting that the ambiguity must be within the current
layout; if the partial name matches one window in the current layout,
and one or more windows not in the current layout, then this is not
ambiguous, and focus will shift to the matching window in the current
layout.
This error was not previous being tested, but in this commit I make
use of the Python API to trigger and test this error.
Error (3) is simple enough, and was already being tested. This is
triggered by something like 'focus status'. The named window needs to
be present in the current layout, and non-focusable in order to
trigger the error.
Error (2) is what I'd like to improve in this commit. This error
triggers if the name the user gives doesn't match any window in the
current layout. Even if GDB does know about the window, but the
window isn't in the current layout, then GDB will say it doesn't
recognize the window name.
In this commit I propose to to split this error into three different
errors. These will be:
(a) Unrecognized window name "NAME"
(b) No windows matching "NAME" in the current layout
(c) Window "NAME" is not in the current layout
Error (a) is the same as before, but will now only trigger if GDB
doesn't know about window NAME at all. If the window is known, but
not in the current layout then one of the other errors will trigger.
Error (b) will trigger if NAME is ambiguous for multiple windows that
are not in the current layout. If NAME identifies a single window in
the current layout then that window will continue to be selected, just
as it currently is. Only in the case where NAME doesn't identify a
window in the current layout do we then check all the other known
windows, if NAME matches multiple of these, then (b) is triggered.
Finally, error (c) is used when NAME uniquely identifies a single
window that is not in the current layout.
The hope with these new errors is that the user will have a better
understanding of what went wrong. Instead of GDB claiming to not know
about a window, the mention of the current layout will hint to the
user that they should first switch layouts.
There are tests included for all the new errors.
Diffstat (limited to 'config.rpath')
0 files changed, 0 insertions, 0 deletions