This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Rename "maint demangle" as "demangle".


On 01/04/2015 10:15 PM, Doug Evans wrote:

> Sorry for the followup, I found pr 15830 and added
> the ability to specify a language.

Excellent, thanks!

> +      else if (strncmp (arg_start, "--", p - arg_start) == 0)
> +	processing_args = 0;

I think this should be:

      else if (strncmp (arg_start, "--", p - arg_start) == 0)
               && isspace (arg_start[3]))
	processing_args = 0;

>  static void
> @@ -1012,8 +988,7 @@ _initialize_maint_cmds (void)
>    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);
>  
> @@ -1083,9 +1058,7 @@ 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."),
> +This command has been moved to \"demangle\"."),
>  	   &maintenancelist);

If you call deprecate_cmd on the old command then GDB
will hide it from e.g., tab command completion.

> +    # Verify specifying demangle language.
> +    gdb_test_no_output "set language unknown"
> +    set_demangling_style "auto"
> +    gdb_test_exact "demangle -l c++ -- _ZSt4cout" "std::cout"
> +    gdb_test_exact "demangle -l c -- _ZSt4cout" "Can't demangle \"_ZSt4cout\""
> +    gdb_test_exact "demangle -l garbage xyzdje" "Unknown language \"garbage\""

It might be good to also test explicitly specifying a
valid language and not using the double dash.  Like, e.g.,

    gdb_test_exact "demangle -l c++ _ZSt4cout" "std::cout"

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]