• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂4965a4a21ad77dec1395d7831186e1a0d11fd769 (tree)
時間2019-06-05 07:30:02
作者Pedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

Remove "show" command completers, "set" command completers for string commands

The default command completer is symbol_completer, but it makes no
sense for a "show" command to complete on symbols, or anything else,
really.

I wonder whether we should instead make the default be no completer.
That seems like a much larger/complicated audit/change, so I'd like to
move forward with this version, as it'll be covered by tests. I
noticed this because a following patch will add a new
gdb.base/settings.exp testcase that exercises all sorts of details of
settings commands, including completing the show commands, using new
representative "maint test-settings <type or settings command>"
commands.

Also remove the completer for var_string and var_string_noescape
commands. No point in completing symbols when GDB is expecting a
string.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* cli/cli-decode.c (add_setshow_cmd_full): Remove "show"
completer.
(add_setshow_string_cmd, add_setshow_string_noescape_cmd): Remove
"set" completers.

Change Summary

差異

--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -509,6 +509,9 @@ add_setshow_cmd_full (const char *name,
509509 full_show_doc, show_list);
510510 show->doc_allocated = 1;
511511 show->show_value_func = show_func;
512+ /* Disable the default symbol completer. Doesn't make much sense
513+ for the "show" command to complete on anything. */
514+ set_cmd_completer (show, nullptr);
512515
513516 if (set_result != NULL)
514517 *set_result = set;
@@ -633,11 +636,16 @@ add_setshow_string_cmd (const char *name, enum command_class theclass,
633636 struct cmd_list_element **set_list,
634637 struct cmd_list_element **show_list)
635638 {
639+ cmd_list_element *set_cmd;
640+
636641 add_setshow_cmd_full (name, theclass, var_string, var,
637642 set_doc, show_doc, help_doc,
638643 set_func, show_func,
639644 set_list, show_list,
640- NULL, NULL);
645+ &set_cmd, NULL);
646+
647+ /* Disable the default symbol completer. */
648+ set_cmd_completer (set_cmd, nullptr);
641649 }
642650
643651 /* Add element named NAME to both the set and show command LISTs (the
@@ -659,6 +667,10 @@ add_setshow_string_noescape_cmd (const char *name, enum command_class theclass,
659667 set_func, show_func,
660668 set_list, show_list,
661669 &set_cmd, NULL);
670+
671+ /* Disable the default symbol completer. */
672+ set_cmd_completer (set_cmd, nullptr);
673+
662674 return set_cmd;
663675 }
664676