#include "objfiles.h"
#include "value.h"
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
extern void _initialize_maint_cmds PARAMS ((void));
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));
{
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
sym = lookup_minimal_symbol_by_pc (address);
if (sym)
- printf_filtered ("%s+%u\n",
+ printf_filtered ("%s+%s\n",
SYMBOL_SOURCE_NAME (sym),
- address - SYMBOL_VALUE_ADDRESS (sym));
+ paddr_u (address - SYMBOL_VALUE_ADDRESS (sym)));
else if (sect)
- printf_filtered ("no symbol at %s:0x%08x\n", sect->name, address);
+ printf_filtered ("no symbol at %s:0x%s\n", sect->name, paddr (address));
else
- printf_filtered ("no symbol at 0x%08x\n", address);
+ printf_filtered ("no symbol at 0x%s\n", paddr (address));
return;
}
&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\