-/* Generate completions one by one for the completer. Each time we are
- called return another potential completion to the caller.
- line_completion just completes on commands or passes the buck to the
- command's completer function, the stuff specific to symbol completion
- is in make_symbol_completion_list.
+/* Complete on signals. */
+
+VEC (char_ptr) *
+signal_completer (struct cmd_list_element *ignore,
+ const char *text, const char *word)
+{
+ VEC (char_ptr) *return_val = NULL;
+ size_t len = strlen (word);
+ enum gdb_signal signum;
+ const char *signame;
+
+ for (signum = GDB_SIGNAL_FIRST; signum != GDB_SIGNAL_LAST; ++signum)
+ {
+ /* Can't handle this, so skip it. */
+ if (signum == GDB_SIGNAL_0)
+ continue;
+
+ signame = gdb_signal_to_name (signum);
+
+ /* Ignore the unknown signal case. */
+ if (!signame || strcmp (signame, "?") == 0)
+ continue;
+
+ if (strncasecmp (signame, word, len) == 0)
+ VEC_safe_push (char_ptr, return_val, xstrdup (signame));
+ }
+
+ return return_val;
+}
+
+/* Get the list of chars that are considered as word breaks
+ for the current command. */
+
+char *
+gdb_completion_word_break_characters (void)
+{
+ VEC (char_ptr) *list;
+
+ list = complete_line_internal (rl_line_buffer, rl_line_buffer, rl_point,
+ handle_brkchars);
+ gdb_assert (list == NULL);
+ return rl_completer_word_break_characters;
+}
+
+/* Generate completions one by one for the completer. Each time we
+ are called return another potential completion to the caller.
+ line_completion just completes on commands or passes the buck to
+ the command's completer function, the stuff specific to symbol
+ completion is in make_symbol_completion_list.