• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

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

Revisionea68593bd2c649a73754e150340ba3400c007682 (tree)
Time2020-07-02 12:21:12
AuthorTom Tromey <tom@trom...>
CommiterTom Tromey

Log Message

Use complete_on_enum in tui_reggroup_completer

tui_reggroup_completer has an "XXXX" comment suggesting the use of
complete_on_enum. This patch implements this suggestion.

gdb/ChangeLog
2020-07-01 Tom Tromey <tom@tromey.com>

* tui/tui-regs.c (tui_reggroup_completer): Use complete_on_enum.

Change Summary

Incremental Difference

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
1+2020-07-01 Tom Tromey <tom@tromey.com>
2+
3+ * tui/tui-regs.c (tui_reggroup_completer): Use complete_on_enum.
4+
15 2020-07-01 Fangrui Song <maskray@google.com>
26
37 * dwarf2/read.c (lnp_state_machine::check_line_address): Test -1.
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -631,18 +631,11 @@ tui_reggroup_completer (struct cmd_list_element *ignore,
631631 completion_tracker &tracker,
632632 const char *text, const char *word)
633633 {
634- static const char *extra[] = { "next", "prev", NULL };
635- size_t len = strlen (word);
636- const char **tmp;
634+ static const char * const extra[] = { "next", "prev", NULL };
637635
638636 reggroup_completer (ignore, tracker, text, word);
639637
640- /* XXXX use complete_on_enum instead? */
641- for (tmp = extra; *tmp != NULL; ++tmp)
642- {
643- if (strncmp (word, *tmp, len) == 0)
644- tracker.add_completion (make_unique_xstrdup (*tmp));
645- }
638+ complete_on_enum (tracker, extra, text, word);
646639 }
647640
648641 void _initialize_tui_regs ();