[RFC] Let "gcore" command accept a suffix argument

Joel Brobecker brobecker@adacore.com
Mon Jun 21 16:57:00 GMT 2010


> 2010-06-21  Hui Zhu  <teawater@gmail.com>
> 
>        * printcmd.c (ui_printf_maybe_filtered): New function.
>        (printf_command): Call ui_printf_maybe_filtered.
>        (_initialize_printcmd): New command "eval".

This is close.

>  static void
> -printf_command (char *arg, int from_tty)
> +ui_printf_maybe_filtered (char *arg, struct ui_file *stream, int filter)

I would personally prefer it if we called this function "ui_printf",
dropping the "maybe_filtered". The "maybe_filtered" is just noise, IMO.

Also, this function needs a comment documenting its behavior.

> +static void
> +printf_command (char *arg, int from_tty)

Please add a comment as well. It can be as simple as ``Implement the
"print" command''.

> +static void
> +eval_command (char *arg, int from_tty)
> +{

And same here.

> +  add_com ("eval", no_class, eval_command, _("\
> +Call command with variable."));

This part will need to be approved by Eli. He's also ask for
documentation.

-- 
Joel



More information about the Gdb-patches mailing list