]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: use the location_completer for the list command
authorGuinevere Larsen <guinevere@redhat.com>
Wed, 23 Jul 2025 12:06:22 +0000 (09:06 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Fri, 25 Jul 2025 16:32:43 +0000 (13:32 -0300)
The "location_completer" function has been available for a long time,
but it was seemingly never used as the completer for the list function.
A quick check through git history shows that a similar completer was
available for the "edit" command but wasn't added to "list" with no
reasoning for it.

I think "list" should use the location_completer, as it is more aware of
the locspec grammar.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/cli/cli-cmds.c

index 5e887f5ceacae88f6fd55589b9045e7ae36f6a27..868f12c23b02da6bf4be5766eace76b08344e85f 100644 (file)
@@ -2898,6 +2898,7 @@ This can be changed using \"set listsize\", and the current value\n\
 can be shown using \"show listsize\"."));
 
   add_com_alias ("l", list_cmd, class_files, 1);
+  set_cmd_completer(list_cmd, location_completer);
 
   c = add_com ("disassemble", class_vars, disassemble_command, _("\
 Disassemble a specified section of memory.\n\