/* Support for GDB maintenance commands.
- Copyright (C) 1992-2021 Free Software Foundation, Inc.
+ Copyright (C) 1992-2022 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
maintenance_time_display (const char *args, int from_tty)
{
if (args == NULL || *args == '\0')
- printf_unfiltered (_("\"maintenance time\" takes a numeric argument.\n"));
+ printf_filtered (_("\"maintenance time\" takes a numeric argument.\n"));
else
set_per_command_time (strtol (args, NULL, 10));
}
maintenance_space_display (const char *args, int from_tty)
{
if (args == NULL || *args == '\0')
- printf_unfiltered ("\"maintenance space\" takes a numeric argument.\n");
+ printf_filtered ("\"maintenance space\" takes a numeric argument.\n");
else
set_per_command_space (strtol (args, NULL, 10));
}
from ABFD. It might be that no such wrapper exists (for example debug
sections don't have such wrappers) in which case nullptr is returned. */
-static obj_section *
+obj_section *
maint_obj_section_from_bfd_section (bfd *abfd,
asection *asection,
objfile *ofile)
{
if (args == NULL || *args == '\0')
{
- printf_unfiltered (_("\"maintenance deprecate\" takes an argument,\n\
+ printf_filtered (_("\"maintenance deprecate\" takes an argument,\n\
the command you want to deprecate, and optionally the replacement command\n\
enclosed in quotes.\n"));
}
{
if (args == NULL || *args == '\0')
{
- printf_unfiltered (_("\"maintenance undeprecate\" takes an argument, \n\
+ printf_filtered (_("\"maintenance undeprecate\" takes an argument, \n\
the command you want to undeprecate.\n"));
}
auto grp = make_maintenance_selftest_option_group (&opts);
gdb::option::process_options
(&args, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_ERROR, grp);
- gdb_argv argv (args);
+ const gdb_argv argv (args);
selftests::run_tests (argv.as_array_view (), opts.verbose);
#else
printf_filtered (_("\
{
auto grp = make_maintenance_selftest_option_group (nullptr);
- gdb::option::complete_options
- (tracker, &text, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_ERROR, grp);
+ if (gdb::option::complete_options
+ (tracker, &text, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_ERROR, grp))
+ return;
+
+#if GDB_SELF_TEST
+ selftests::for_each_selftest ([&tracker, text] (const std::string &name)
+ {
+ if (startswith (name.c_str (), text))
+ tracker.add_completion (make_unique_xstrdup (name.c_str ()));
+ });
+#endif
}
static void