+2020-05-03 Tom Tromey <tom@tromey.com>
+
+ * breakpoint.c (catch_command, tcatch_command): Remove.
+ (_initialize_breakpoint): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ (set_breakpoint_cmd, show_breakpoint_cmd): Remove
+ * utils.c (set_internal_problem_cmd, show_internal_problem_cmd):
+ Remove.
+ (add_internal_problem_command): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * mips-tdep.c (set_mipsfpu_command): Remove.
+ (_initialize_mips_tdep): Use add_basic_prefix_cmd.
+ * dwarf2/index-cache.c (set_index_cache_command): Remove.
+ (_initialize_index_cache): Use add_basic_prefix_cmd.
+ * memattr.c (dummy_cmd): Remove.
+ (_initialize_mem): Use add_basic_prefix_cmd, add_show_prefix_cmd.
+ * tui/tui-win.c (set_tui_cmd, show_tui_cmd): Remove.
+ (_initialize_tui_win): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * cli/cli-logging.c (set_logging_command): Remove.
+ (_initialize_cli_logging): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ (show_logging_command): Remove.
+ * target.c (target_command): Remove.
+ (add_target): Use add_basic_prefix_cmd.
+
2020-05-02 Hannes Domani <ssbssa@yahoo.de>
* gdbtypes.h (enum dynamic_prop_node_kind): Fix typo.
b->language = language_ada;
}
-static void
-catch_command (const char *arg, int from_tty)
-{
- error (_("Catch requires an event name."));
-}
\f
-static void
-tcatch_command (const char *arg, int from_tty)
-{
- error (_("Catch requires an event name."));
-}
-
/* Compare two breakpoints and return a strcmp-like result. */
static int
});
}
\f
-static void
-set_breakpoint_cmd (const char *args, int from_tty)
-{
-}
-
-static void
-show_breakpoint_cmd (const char *args, int from_tty)
-{
-}
-
/* Invalidate last known value of any hardware watchpoint if
the memory which that value represents has been written to by
GDB itself. */
breakpoint set."),
&maintenanceinfolist);
- add_prefix_cmd ("catch", class_breakpoint, catch_command, _("\
+ add_basic_prefix_cmd ("catch", class_breakpoint, _("\
Set catchpoints to catch events."),
- &catch_cmdlist, "catch ",
- 0/*allow-unknown*/, &cmdlist);
+ &catch_cmdlist, "catch ",
+ 0/*allow-unknown*/, &cmdlist);
- add_prefix_cmd ("tcatch", class_breakpoint, tcatch_command, _("\
+ add_basic_prefix_cmd ("tcatch", class_breakpoint, _("\
Set temporary catchpoints to catch events."),
- &tcatch_cmdlist, "tcatch ",
- 0/*allow-unknown*/, &cmdlist);
+ &tcatch_cmdlist, "tcatch ",
+ 0/*allow-unknown*/, &cmdlist);
add_catch_command ("fork", _("Catch calls to fork."),
catch_fork_command_1,
c = add_com_alias ("save-tracepoints", "save tracepoints", class_trace, 0);
deprecate_cmd (c, "save tracepoints");
- add_prefix_cmd ("breakpoint", class_maintenance, set_breakpoint_cmd, _("\
+ add_basic_prefix_cmd ("breakpoint", class_maintenance, _("\
Breakpoint specific settings.\n\
Configure various breakpoint-specific variables such as\n\
pending breakpoint behavior."),
- &breakpoint_set_cmdlist, "set breakpoint ",
- 0/*allow-unknown*/, &setlist);
- add_prefix_cmd ("breakpoint", class_maintenance, show_breakpoint_cmd, _("\
+ &breakpoint_set_cmdlist, "set breakpoint ",
+ 0/*allow-unknown*/, &setlist);
+ add_show_prefix_cmd ("breakpoint", class_maintenance, _("\
Breakpoint specific settings.\n\
Configure various breakpoint-specific variables such as\n\
pending breakpoint behavior."),
- &breakpoint_show_cmdlist, "show breakpoint ",
- 0/*allow-unknown*/, &showlist);
+ &breakpoint_show_cmdlist, "show breakpoint ",
+ 0/*allow-unknown*/, &showlist);
add_setshow_auto_boolean_cmd ("pending", no_class,
&pending_break_support, _("\
saved_filename = NULL;
}
-static void
-set_logging_command (const char *args, int from_tty)
-{
- printf_unfiltered (_("\"set logging\" lets you log output to a file.\n"
- "Usage: set logging on [FILENAME]\n"
- " set logging off\n"
- " set logging file FILENAME\n"
- " set logging overwrite [on|off]\n"
- " set logging redirect [on|off]\n"));
-}
-
-static void
-show_logging_command (const char *args, int from_tty)
-{
- if (saved_filename)
- printf_unfiltered (_("Currently logging to \"%s\".\n"), saved_filename);
- if (saved_filename == NULL
- || strcmp (logging_filename, saved_filename) != 0)
- printf_unfiltered (_("Future logs will be written to %s.\n"),
- logging_filename);
-
- if (logging_overwrite)
- printf_unfiltered (_("Logs will overwrite the log file.\n"));
- else
- printf_unfiltered (_("Logs will be appended to the log file.\n"));
-
- if (logging_redirect)
- printf_unfiltered (_("Output will be sent only to the log file.\n"));
- else
- printf_unfiltered (_("Output will be logged and displayed.\n"));
-
- if (debug_redirect)
- printf_unfiltered (_("Debug output will be sent only to the log file.\n"));
- else
- printf_unfiltered (_("Debug output will be logged and displayed.\n"));
-}
-
void _initialize_cli_logging ();
void
_initialize_cli_logging ()
{
static struct cmd_list_element *set_logging_cmdlist, *show_logging_cmdlist;
- add_prefix_cmd ("logging", class_support, set_logging_command,
- _("Set logging options."), &set_logging_cmdlist,
- "set logging ", 0, &setlist);
- add_prefix_cmd ("logging", class_support, show_logging_command,
- _("Show logging options."), &show_logging_cmdlist,
- "show logging ", 0, &showlist);
+ add_basic_prefix_cmd ("logging", class_support,
+ _("Set logging options."), &set_logging_cmdlist,
+ "set logging ", 0, &setlist);
+ add_show_prefix_cmd ("logging", class_support,
+ _("Show logging options."), &show_logging_cmdlist,
+ "show logging ", 0, &showlist);
add_setshow_boolean_cmd ("overwrite", class_support, &logging_overwrite, _("\
Set whether logging overwrites or appends to the log file."), _("\
Show whether logging overwrites or appends to the log file."), _("\
return m_dir + SLASH_STRING + build_id_str + suffix;
}
-/* "set index-cache" handler. */
-
-static void
-set_index_cache_command (const char *arg, int from_tty)
-{
- printf_unfiltered (_("\
-Missing arguments. See \"help set index-cache\" for help.\n"));
-}
-
/* True when we are executing "show index-cache". This is used to improve the
printout a little bit. */
static bool in_show_index_cache_command = false;
warning (_("Couldn't determine a path for the index cache directory."));
/* set index-cache */
- add_prefix_cmd ("index-cache", class_files, set_index_cache_command,
- _("Set index-cache options."), &set_index_cache_prefix_list,
- "set index-cache ", false, &setlist);
+ add_basic_prefix_cmd ("index-cache", class_files,
+ _("Set index-cache options."),
+ &set_index_cache_prefix_list,
+ "set index-cache ", false, &setlist);
/* show index-cache */
add_prefix_cmd ("index-cache", class_files, show_index_cache_command,
dont_repeat ();
}
-static void
-dummy_cmd (const char *args, int from_tty)
-{
-}
-
static struct cmd_list_element *mem_set_cmdlist;
static struct cmd_list_element *mem_show_cmdlist;
add_info ("mem", info_mem_command,
_("Memory region attributes."));
- add_prefix_cmd ("mem", class_vars, dummy_cmd, _("\
+ add_basic_prefix_cmd ("mem", class_vars, _("\
Memory regions settings."),
- &mem_set_cmdlist, "set mem ",
- 0/* allow-unknown */, &setlist);
- add_prefix_cmd ("mem", class_vars, dummy_cmd, _("\
+ &mem_set_cmdlist, "set mem ",
+ 0/* allow-unknown */, &setlist);
+ add_show_prefix_cmd ("mem", class_vars, _("\
Memory regions settings."),
- &mem_show_cmdlist, "show mem ",
- 0/* allow-unknown */, &showlist);
+ &mem_show_cmdlist, "show mem ",
+ 0/* allow-unknown */, &showlist);
add_setshow_boolean_cmd ("inaccessible-by-default", no_class,
&inaccessible_by_default, _("\
}
-static void
-set_mipsfpu_command (const char *args, int from_tty)
-{
- printf_unfiltered ("\"set mipsfpu\" must be followed by \"double\", "
- "\"single\",\"none\" or \"auto\".\n");
- show_mipsfpu_command (args, from_tty);
-}
-
static void
set_mipsfpu_single_command (const char *args, int from_tty)
{
/* Let the user turn off floating point and set the fence post for
heuristic_proc_start. */
- add_prefix_cmd ("mipsfpu", class_support, set_mipsfpu_command,
- _("Set use of MIPS floating-point coprocessor."),
- &mipsfpulist, "set mipsfpu ", 0, &setlist);
+ add_basic_prefix_cmd ("mipsfpu", class_support,
+ _("Set use of MIPS floating-point coprocessor."),
+ &mipsfpulist, "set mipsfpu ", 0, &setlist);
add_cmd ("single", class_support, set_mipsfpu_single_command,
_("Select single-precision MIPS floating-point coprocessor."),
&mipsfpulist);
fprintf_filtered (file, _("Target debugging is %s.\n"), value);
}
-/* The user just typed 'target' without the name of a target. */
-
-static void
-target_command (const char *arg, int from_tty)
-{
- fputs_filtered ("Argument required (target name). Try `help target'\n",
- gdb_stdout);
-}
-
int
target_has_all_memory_1 (void)
{
func_slot = func;
if (targetlist == NULL)
- add_prefix_cmd ("target", class_run, target_command, _("\
+ add_basic_prefix_cmd ("target", class_run, _("\
Connect to a target machine or process.\n\
The first argument is the type or protocol of the target machine.\n\
Remaining arguments are interpreted by the target protocol. For more\n\
information on the arguments for a particular protocol, type\n\
`help target ' followed by the protocol name."),
- &targetlist, "target ", 0, &cmdlist);
+ &targetlist, "target ", 0, &cmdlist);
c = add_cmd (t.shortname, no_class, t.doc, &targetlist);
set_cmd_context (c, (void *) &t);
set_cmd_sfunc (c, open_target);
+2020-05-03 Tom Tromey <tom@tromey.com>
+
+ * gdb.base/sepdebug.exp: Remove "catch" test.
+ * gdb.base/break.exp: Remove "catch" test.
+ * gdb.base/default.exp: Update expected output.
+
2020-05-02 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (supports_mpx_check_pointer_bounds): New proc.
#
if ![runto_main] then { fail "break tests suppressed" }
-gdb_test "catch" \
- "Catch requires an event name." \
- "catch requires an event name"
-
gdb_test "catch fork" "Catchpoint \[0-9\]+ \\(fork\\)" \
"set catch fork, never expected to trigger"
#test catch
-gdb_test "catch" "Catch requires an event name..*"
+gdb_test "catch" "List of catch subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help catch\" followed by catch subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
#test cd
gdb_test "cd" "Working directory \[^\r\n\]*\(\r\n \\(canonically \[^\r\n\]*\\)\)?\\."
}
#test target
-gdb_test "target" "Argument required .target name.*"
+gdb_test "target" "List of target subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help target\" followed by target subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
#test tbreak
gdb_test "tbreak" "No default breakpoint address now."
#test thread
#
if ![runto_main] then { fail "sepdebug tests suppressed" }
-gdb_test "catch" "Catch requires an event name.*" \
- "catch requires an event name"
-
gdb_test "catch fork" "Catchpoint \[0-9\]+ \\(fork\\)" \
"set catch fork, never expected to trigger"
return need_redraw;
}
-static void
-set_tui_cmd (const char *args, int from_tty)
-{
-}
-
-static void
-show_tui_cmd (const char *args, int from_tty)
-{
-}
-
static struct cmd_list_element *tuilist;
struct cmd_list_element **
/* Define the classes of commands.
They will appear in the help list in the reverse of this order. */
- add_prefix_cmd ("tui", class_tui, set_tui_cmd,
- _("TUI configuration variables."),
- &tui_setlist, "set tui ",
- 0 /* allow-unknown */, &setlist);
- add_prefix_cmd ("tui", class_tui, show_tui_cmd,
- _("TUI configuration variables."),
- &tui_showlist, "show tui ",
- 0 /* allow-unknown */, &showlist);
+ add_basic_prefix_cmd ("tui", class_tui,
+ _("TUI configuration variables."),
+ &tui_setlist, "set tui ",
+ 0 /* allow-unknown */, &setlist);
+ add_show_prefix_cmd ("tui", class_tui,
+ _("TUI configuration variables."),
+ &tui_showlist, "show tui ",
+ 0 /* allow-unknown */, &showlist);
add_com ("refresh", class_tui, tui_refresh_all_command,
_("Refresh the terminal display."));
va_end (ap);
}
-/* Dummy functions to keep add_prefix_cmd happy. */
-
-static void
-set_internal_problem_cmd (const char *args, int from_tty)
-{
-}
-
-static void
-show_internal_problem_cmd (const char *args, int from_tty)
-{
-}
-
/* When GDB reports an internal problem (error or warning) it gives
the user the opportunity to quit GDB and/or create a core file of
the current debug session. This function registers a few commands
show_doc = xstrprintf (_("Show what GDB does when %s is detected."),
problem->name);
- add_prefix_cmd (problem->name,
- class_maintenance, set_internal_problem_cmd, set_doc,
- set_cmd_list,
- concat ("maintenance set ", problem->name, " ",
- (char *) NULL),
- 0/*allow-unknown*/, &maintenance_set_cmdlist);
-
- add_prefix_cmd (problem->name,
- class_maintenance, show_internal_problem_cmd, show_doc,
- show_cmd_list,
- concat ("maintenance show ", problem->name, " ",
- (char *) NULL),
- 0/*allow-unknown*/, &maintenance_show_cmdlist);
+ add_basic_prefix_cmd (problem->name, class_maintenance, set_doc,
+ set_cmd_list,
+ concat ("maintenance set ", problem->name, " ",
+ (char *) NULL),
+ 0/*allow-unknown*/, &maintenance_set_cmdlist);
+
+ add_show_prefix_cmd (problem->name, class_maintenance, show_doc,
+ show_cmd_list,
+ concat ("maintenance show ", problem->name, " ",
+ (char *) NULL),
+ 0/*allow-unknown*/, &maintenance_show_cmdlist);
if (problem->user_settable_should_quit)
{