expression.h: New ops OP_NSSTRING, OP_SELECTOR, OP_MSGCALL, and OP_SELF.
[deliverable/binutils-gdb.git] / gdb / maint.c
index ddaa390b683b27e2f34090ca364cc33488333936..6a849f9c8710f5b374eb6fc63926e2ce34553eed 100644 (file)
@@ -118,8 +118,18 @@ maintenance_dump_me (char *args, int from_tty)
 static void
 maintenance_internal_error (char *args, int from_tty)
 {
-  internal_error (__FILE__, __LINE__,
-                 "internal maintenance");
+  internal_error (__FILE__, __LINE__, "%s", (args == NULL ? "" : args));
+}
+
+/* Stimulate the internal error mechanism that GDB uses when an
+   internal problem is detected.  Allows testing of the mechanism.
+   Also useful when the user wants to drop a core file but not exit
+   GDB. */
+
+static void
+maintenance_internal_warning (char *args, int from_tty)
+{
+  internal_warning (__FILE__, __LINE__, "%s", (args == NULL ? "" : args));
 }
 
 /* Someday we should allow demangling for things other than just
@@ -697,6 +707,11 @@ itself a SIGQUIT signal.",
 Cause GDB to behave as if an internal error was detected.",
           &maintenancelist);
 
+  add_cmd ("internal-warning", class_maintenance, maintenance_internal_warning,
+          "Give GDB an internal warning.\n\
+Cause GDB to behave as if an internal warning was reported.",
+          &maintenancelist);
+
   add_cmd ("demangle", class_maintenance, maintenance_demangle,
           "Demangle a C++ mangled name.\n\
 Call internal GDB demangler routine to demangle a C++ link name\n\
@@ -783,16 +798,15 @@ passes without a response from the target, an error occurs.", &setlist),
 
 
 #ifdef NOTYET
-  /* FIXME: cagney/2001-09-24: A patch introducing a
-     add_set_boolean_cmd() is pending, the below should probably use
-     it.  A patch implementing profiling is pending, this just sets up
-     the framework.  */
-  tmpcmd = add_set_cmd ("profile", class_maintenance,
-                       var_boolean, &maintenance_profile_p,
-                       "Set internal profiling.\n\
-When enabled GDB is profiled.",
-                       &maintenance_set_cmdlist);
-  set_cmd_sfunc (tmpcmd, maintenance_set_profile_cmd);
-  add_show_from_set (tmpcmd, &maintenance_show_cmdlist);
+  /* FIXME: cagney/2002-06-15: A patch implementing profiling is
+     pending, this just sets up the framework.  */
+  tmpcmd = add_setshow_boolean_cmd ("profile", class_maintenance,
+                                   var_boolean, &maintenance_profile_p, "\
+Set internal profiling.\n\
+When enabled GDB is profiled.", "\
+Show internal profiling.\n",
+                                   maintenance_set_profile_cmd, NULL,
+                                   &maintenance_set_cmdlist,
+                                   &maintenance_show_cmdlist);
 #endif
 }
This page took 0.02442 seconds and 4 git commands to generate.