aboutsummaryrefslogtreecommitdiff
path: root/gdb/maint.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-09-18 23:53:52 +0000
committerAndrew Cagney <cagney@redhat.com>2002-09-18 23:53:52 +0000
commitdec43320d95c180b5601a515fa18bfe541df0448 (patch)
treec900791d7b4563b4faf1a96ea7236a80337a8583 /gdb/maint.c
parentb81654f1c061cfbadd7e270a2920b014d4c9cfdd (diff)
downloadfsf-binutils-gdb-dec43320d95c180b5601a515fa18bfe541df0448.zip
fsf-binutils-gdb-dec43320d95c180b5601a515fa18bfe541df0448.tar.gz
fsf-binutils-gdb-dec43320d95c180b5601a515fa18bfe541df0448.tar.bz2
2002-09-18 Andrew Cagney <ac131313@redhat.com>
* maint.c (maintenance_internal_error): Print the parameter as the error message. (maintenance_internal_warning): New function. (_initialize_maint_cmds): Add command `maint internal-warning'. * defs.h (internal_warning, internal_vwarning): Declare. * utils.c (struct internal_problem): Define. (internal_vproblem): New function. (internal_warning): New function. (internal_vwarning): New function. (internal_warning_problem, internal_error_problem): New variables. (internal_verror): Just call internal_vproblem. Index: testsuite/ChangeLog 2002-09-18 Andrew Cagney <ac131313@redhat.com> * gdb.base/maint.exp: Check `help maint internal-warning'.
Diffstat (limited to 'gdb/maint.c')
-rw-r--r--gdb/maint.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gdb/maint.c b/gdb/maint.c
index f09703f..6a849f9 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -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\