Patch: `maint
Andrew Cagney
ac131313@cygnus.com
Sat Apr 1 00:00:00 GMT 2000
Tom Tromey wrote:
(I've no opinion on the actual command - if it helps improve profiling
then it is probably good :-)
> +/* "maintenance profile-gdb <on|off>" */
> +static void
> +maint_profile_gdb (char *arg, int from_tty)
> +{
> +#ifdef ENABLE_PROFILE
> + int val;
> + if (arg == NULL || ! *arg)
> + error ("requires argument (\"on\" or \"off\"");
> + if (! strcmp (arg, "on"))
> + val = 1;
> + else if (! strcmp (arg, "off"))
> + val = 0;
> + else
> + error ("unrecognized argument; must be \"on\" or \"off\"");
> + moncontrol (val);
> +#else
> + error ("gdb was not configured with --enable-profiling");
> +#endif
> +}
> +
Have a look at the (cumbersom) add_set_enum_cmd() interface. By using
that interface, the interaction:
(gdb) maint profile-gdb <TAB>
will correctly list the set of choices available to the user. See also:
(gdb) set remote X-packet <TAB>
auto disable enable
enjoy,
Andrew
More information about the Gdb-patches
mailing list