diff options
Diffstat (limited to 'gdb/maint.c')
-rw-r--r-- | gdb/maint.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/maint.c b/gdb/maint.c index f5977ec..766ab74 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -39,6 +39,7 @@ #include "inferior.h" #include "gdbsupport/thread-pool.h" #include "event-top.h" +#include "cp-support.h" #include "cli/cli-decode.h" #include "cli/cli-utils.h" @@ -108,6 +109,18 @@ maintenance_demangle (const char *args, int from_tty) styled_string (command_style.style (), "demangle")); } +/* Print the canonical form of a name. */ + +static void +maintenance_canonicalize (const char *args, int from_tty) +{ + gdb::unique_xmalloc_ptr<char> canon = cp_canonicalize_string (args); + if (canon == nullptr) + gdb_printf ("No change.\n"); + else + gdb_printf ("canonical = %s\n", canon.get ()); +} + static void maintenance_time_display (const char *args, int from_tty) { @@ -1343,6 +1356,12 @@ This command has been moved to \"demangle\"."), &maintenancelist); deprecate_cmd (cmd, "demangle"); + cmd = add_cmd ("canonicalize", class_maintenance, maintenance_canonicalize, + _("\ +Show the canonical form of a C++ name.\n\ +Usage: maintenance canonicalize NAME"), + &maintenancelist); + add_prefix_cmd ("per-command", class_maintenance, set_per_command_cmd, _("\ Per-command statistics settings."), &per_command_setlist, |