/* Support for GDB maintenance commands.
- Copyright (C) 1992-2015 Free Software Foundation, Inc.
+ Copyright (C) 1992-2016 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
#include "arch-utils.h"
#include <ctype.h>
#include <signal.h>
-#include <sys/time.h>
+#include "gdb_sys_time.h"
#include <time.h>
#include "command.h"
#include "gdbcmd.h"
#include "top.h"
#include "timeval-utils.h"
#include "maint.h"
+#include "selftest.h"
#include "cli/cli-decode.h"
#include "cli/cli-utils.h"
{
flagword flags = bfd_get_section_flags (abfd, asect);
const char *name = bfd_section_name (abfd, asect);
- const char *arg = datum;
+ const char *arg = (const char *) datum;
if (arg == NULL || *arg == '\0'
|| match_substring (arg, name)
set_per_command_cmd (char *args, int from_tty)
{
struct cmd_list_element *list;
- size_t length;
int val;
val = parse_cli_boolean_value (args);
{
cmd_show_list (per_command_showlist, from_tty, "");
}
+\f
+
+/* The "maintenance selftest" command. */
+
+static void
+maintenance_selftest (char *args, int from_tty)
+{
+ run_self_tests ();
+}
+
\f
void
_initialize_maint_cmds (void)
If you decide you want to use it: maintenance undeprecate 'commandname'"),
&maintenancelist);
+ add_cmd ("selftest", class_maintenance, maintenance_selftest, _("\
+Run gdb's unit tests.\n\
+Usage: maintenance selftest\n\
+This will run any unit tests that were built in to gdb.\n\
+gdb will abort if any test fails."),
+ &maintenancelist);
+
add_setshow_zinteger_cmd ("watchdog", class_maintenance, &watchdog, _("\
Set watchdog timer."), _("\
Show watchdog timer."), _("\