[PATCH] Add completion styling
Pedro Alves
palves@redhat.com
Sun May 24 15:30:07 GMT 2020
On 5/24/20 3:42 PM, Eli Zaretskii wrote:
>> Cc: gdb-patches@sourceware.org
>> From: Pedro Alves <palves@redhat.com>
>> Date: Sun, 24 May 2020 13:58:02 +0100
>>
>> Try "b main[TAB]" when debugging GDB, and you'll see that GDB
>> highlights the "t" as the first different character here:
>>
>> selftests::string_view::cons_1::main()
>> selftests::string_view::cons_2::main()
>> selftests::string_view::cons_3::main()
>> ^
>>
>> while it should highlight here:
>>
>> selftests::string_view::cons_1::main()
>> selftests::string_view::cons_2::main()
>> selftests::string_view::cons_3::main()
>> ^
>
> Really? not here:
>
> selftests::string_view::cons_1::main()
> ^
I don't understand. Under the "1"? Why?
My understanding is that "set style completion-difference" highlights the
first character that follows the string that the user typed, right?
So if you type "b main[TAB]", for the "selftests::string_view::cons_1::main()"
symbol, after "main" comes the open parenthesis. Just like here,
you get a highlight under the "t" in "maint":
maintenance_translate_address(char const*, int)
^
> But I actually don't understand how did we get these candidates by
> typing "main". Don't we complete by looking for strings that begin
> with what the user typed? I'm probably missing something here.
You're missing that "b main" sets a breakpoint on every "main"
function in every namespace. "b -qualified main" disables that.
Thanks,
Pedro Alves
More information about the Gdb-patches
mailing list