[PATCH] gdb: improve command completion for 'print', 'x', and 'display'
Pedro Alves
pedro@palves.net
Fri Jan 8 15:08:00 GMT 2021
On 08/01/21 10:34, Andrew Burgess wrote:
> * Pedro Alves <pedro@palves.net> [2021-01-08 00:59:25 +0000]:
>
>> On 27/11/20 11:13, Andrew Burgess wrote:
>>> Previously when analysing /FMT strings for tab completion we
>>> considered two possibilities, either the user has typed '/', or the
>>> user has typed '/' followed by an alpha-numeric character, as these
>>> are the only valid FMT string characters.
>>>
>>> This meant that if the user type, for example '/@' and then tried to
>>> tab complete gdb would use an uninitialised variable.
>>>
>>> Currently only the first character after the '/' is checked to see if
>>> it is alpha-numeric, so if a user typed '/x@@' then gdb would be happy
>>> to treat this as a FMT string.
>>>
>>> Given the goal of this change was primarily to allow tab completion of
>>> symbols later in the command when a /FMT was used then I decided to
>>> just make the /FMT skipping less smart. Now any characters after the
>>> '/' up to the first white space, will be treated as a FMT string.
>>
>> Do we already have a test for this?
>
> No. My bad.
>
> How about the below?
LGTM, thanks!
More information about the Gdb-patches
mailing list