import gdb-1999-08-16 snapshot
[deliverable/binutils-gdb.git] / gdb / maint.c
index 4ec051ad991c2aeda4ec8016a2d5e5f4e5303ea3..10cf6bbde5f2ed19a997824597891171ca39c3d3 100644 (file)
@@ -45,6 +45,8 @@ static void maintenance_command PARAMS ((char *, int));
 
 static void maintenance_dump_me PARAMS ((char *, int));
 
+static void maintenance_internal_error PARAMS ((char *args, int from_tty));
+
 static void maintenance_demangle PARAMS ((char *, int));
 
 static void maintenance_time_display PARAMS ((char *, int));
@@ -99,12 +101,29 @@ maintenance_dump_me (args, from_tty)
 {
   if (query ("Should GDB dump core? "))
     {
+#ifdef __DJGPP__
+      /* SIGQUIT by default is ignored, so use SIGABRT instead.  */
+      signal (SIGABRT, SIG_DFL);
+      kill (getpid (), SIGABRT);
+#else
       signal (SIGQUIT, SIG_DFL);
       kill (getpid (), SIGQUIT);
+#endif
     }
 }
 #endif
 
+/* 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_error (char *args, int from_tty)
+{
+  internal_error ("internal maintenance");
+}
+
 /*  Someday we should allow demangling for things other than just
    explicit strings.  For example, we might want to be able to
    specify the address of a string in either GDB's process space
@@ -378,6 +397,11 @@ itself a SIGQUIT signal.",
           &maintenancelist);
 #endif
 
+  add_cmd ("internal-error", class_maintenance, maintenance_internal_error,
+          "Give GDB an internal error.\n\
+Cause GDB to behave as if an internal error was detected.",
+          &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\
This page took 0.024512 seconds and 4 git commands to generate.