+2019-05-10 Tom Tromey <tromey@adacore.com>
+
+ * ada-lang.c (catch_ada_completer): New function.
+ (_initialize_ada_language): Use it.
+
2019-05-10 Tom Tromey <tromey@adacore.com>
* thread.c (print_thread_info): Make "requested_threads" const.
from_tty);
}
+/* Completion function for the Ada "catch" commands. */
+
+static void
+catch_ada_completer (struct cmd_list_element *cmd, completion_tracker &tracker,
+ const char *text, const char *word)
+{
+ std::vector<ada_exc_info> exceptions = ada_exceptions_list (NULL);
+
+ for (const ada_exc_info &info : exceptions)
+ {
+ if (startswith (info.name, word))
+ tracker.add_completion
+ (gdb::unique_xmalloc_ptr<char> (xstrdup (info.name)));
+ }
+}
+
/* Split the arguments specified in a "catch assert" command.
ARGS contains the command's arguments (or the empty string if
Otherwise, the catchpoint only stops when the name of the exception being\n\
raised is the same as ARG."),
catch_ada_exception_command,
- NULL,
+ catch_ada_completer,
CATCH_PERMANENT,
CATCH_TEMPORARY);
Catch Ada exceptions, when handled.\n\
With an argument, catch only exceptions with the given name."),
catch_ada_handlers_command,
- NULL,
+ catch_ada_completer,
CATCH_PERMANENT,
CATCH_TEMPORARY);
add_catch_command ("assert", _("\
+2019-05-10 Tom Tromey <tromey@adacore.com>
+
+ * gdb.ada/info_exc.exp: Add "complete" test.
+
2019-05-09 Tom de Vries <tdevries@suse.de>
* gdb.arch/amd64-tailcall-self.S: Make DW_FORM_ref4 references
"constraint_error: $hex" \
"const.aint_global_gdb_e: $hex"]
+foreach cmd {exception handlers} {
+ gdb_test "complete catch $cmd const.a" \
+ "catch $cmd const.aint_global_gdb_e"
+}