diff options
author | Gary Benson <gbenson@redhat.com> | 2014-06-19 09:10:44 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2014-06-19 09:10:44 +0100 |
commit | 57fcfb1b202c09bf83e0e98dfb1d518e7be71d2c (patch) | |
tree | cc0e0de9c1ae26d1fc99717964a3d3321e9340dc /gdb/maint.c | |
parent | 45371d0ceec9e0771306060c49f378eea01b1269 (diff) | |
download | gdb-57fcfb1b202c09bf83e0e98dfb1d518e7be71d2c.zip gdb-57fcfb1b202c09bf83e0e98dfb1d518e7be71d2c.tar.gz gdb-57fcfb1b202c09bf83e0e98dfb1d518e7be71d2c.tar.bz2 |
Add new internal problem for demangler warnings
This commit adds a new category of internal problem for demangler
warnings. Demangler warnings behave in much the same way as internal
warnings except that they do not create core files and no option to
change this is presented to the user.
gdb/
2014-06-19 Gary Benson <gbenson@redhat.com>
* utils.h (demangler_vwarning): New declaration.
(demangler_warning): Likewise.
* utils.c (struct internal_problem)
<user_settable_should_quit>: New field.
<user_settable_should_dump_core>: Likewise
(internal_error_problem): Add values for above new fields.
(internal_warning_problem): Likewise.
(demangler_warning_problem): New static global.
(demangler_vwarning): New function.
(demangler_warning): Likewise.
(add_internal_problem_command): Selectively add commands.
(_initialize_utils): New internal problem command.
* maint.c (maintenance_demangler_warning): New function.
(_initialize_maint_cmds): New command.
gdb/doc/
2014-06-19 Gary Benson <gbenson@redhat.com>
* gdb.texinfo (Maintenance Commands): Document new
"maint demangler-warning" command and new
"maint set/show demangler-warning" option.
Diffstat (limited to 'gdb/maint.c')
-rw-r--r-- | gdb/maint.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/maint.c b/gdb/maint.c index 30a9d3b..5f34af3 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -131,6 +131,15 @@ maintenance_internal_warning (char *args, int from_tty) internal_warning (__FILE__, __LINE__, "%s", (args == NULL ? "" : args)); } +/* Stimulate the internal error mechanism that GDB uses when an + demangler problem is detected. Allows testing of the mechanism. */ + +static void +maintenance_demangler_warning (char *args, int from_tty) +{ + demangler_warning (__FILE__, __LINE__, "%s", (args == NULL ? "" : args)); +} + /* 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 or the @@ -1055,6 +1064,12 @@ Give GDB an internal warning.\n\ Cause GDB to behave as if an internal warning was reported."), &maintenancelist); + add_cmd ("demangler-warning", class_maintenance, + maintenance_demangler_warning, _("\ +Give GDB a demangler warning.\n\ +Cause GDB to behave as if a demangler warning was reported."), + &maintenancelist); + add_cmd ("demangle", class_maintenance, maintenance_demangle, _("\ Demangle a C++/ObjC mangled name.\n\ Call internal GDB demangler routine to demangle a C++ link name\n\ |