forked from Imagelibrary/binutils-gdb
PR gdb/15830
gdb/ChangeLog: PR gdb/15830 * NEWS: The "maint demangle" command is renamed as "demangle". * demangle.c: #include cli/cli-utils.h, language.h. (demangle_command): New function. (_initialize_demangle): Add new command "demangle". * maint.c (maintenance_demangle): Stub out. (_initialize_maint_cmds): Update help text for "maint demangle", and mark as deprecated. gdb/doc/ChangeLog: * gdb.texinfo (Debugging C Plus Plus): Mention "demangle". (Symbols): Ditto. (Maintenance Commands): Delete docs for "maint demangle". gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Remove references to "maint demangle". * gdb.cp/demangle.exp: Update. "maint demangle" -> "demangle". Add tests for explicitly specifying language to demangle. * gdb.dlang/demangle.exp: Ditto.
This commit is contained in:
46
gdb/maint.c
46
gdb/maint.c
@@ -139,38 +139,14 @@ 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
|
||||
debuggee's process space, and have gdb fetch and demangle that
|
||||
string. If we have a char* pointer "ptr" that points to a string,
|
||||
we might want to be able to given just the name and have GDB
|
||||
demangle and print what it points to, etc. (FIXME) */
|
||||
/* Old command to demangle a string. The command has been moved to "demangle".
|
||||
It is kept for now because otherwise "mt demangle" gets interpreted as
|
||||
"mt demangler-warning" which artificially creates an internal gdb error. */
|
||||
|
||||
static void
|
||||
maintenance_demangle (char *args, int from_tty)
|
||||
{
|
||||
char *demangled;
|
||||
|
||||
if (args == NULL || *args == '\0')
|
||||
{
|
||||
printf_unfiltered (_("\"maintenance demangle\" takes "
|
||||
"an argument to demangle.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
demangled = language_demangle (current_language, args,
|
||||
DMGL_ANSI | DMGL_PARAMS);
|
||||
if (demangled != NULL)
|
||||
{
|
||||
printf_unfiltered ("%s\n", demangled);
|
||||
xfree (demangled);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf_unfiltered (_("Can't demangle \"%s\"\n"), args);
|
||||
}
|
||||
}
|
||||
printf_filtered (_("This command has been moved to \"demangle\".\n"));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1009,11 +985,12 @@ show_per_command_cmd (char *args, int from_tty)
|
||||
void
|
||||
_initialize_maint_cmds (void)
|
||||
{
|
||||
struct cmd_list_element *cmd;
|
||||
|
||||
add_prefix_cmd ("maintenance", class_maintenance, maintenance_command, _("\
|
||||
Commands for use by GDB maintainers.\n\
|
||||
Includes commands to dump specific internal GDB structures in\n\
|
||||
a human readable form, to cause GDB to deliberately dump core,\n\
|
||||
to test internal functions such as the C++/ObjC demangler, etc."),
|
||||
a human readable form, to cause GDB to deliberately dump core, etc."),
|
||||
&maintenancelist, "maintenance ", 0,
|
||||
&cmdlist);
|
||||
|
||||
@@ -1082,11 +1059,10 @@ 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\
|
||||
and prints the result."),
|
||||
&maintenancelist);
|
||||
cmd = add_cmd ("demangle", class_maintenance, maintenance_demangle, _("\
|
||||
This command has been moved to \"demangle\"."),
|
||||
&maintenancelist);
|
||||
deprecate_cmd (cmd, "demangle");
|
||||
|
||||
add_prefix_cmd ("per-command", class_maintenance, set_per_command_cmd, _("\
|
||||
Per-command statistics settings."),
|
||||
|
||||
Reference in New Issue
Block a user