This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Let "gcore" command accept a suffix argument
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: Stan Shebs <stanshebs at earthlink dot net>, Tom Tromey <tromey at redhat dot com>, Stan Shebs <stan at codesourcery dot com>, Michael Snyder <msnyder at vmware dot com>, gdb-patches ml <gdb-patches at sourceware dot org>, Eli Zaretskii <eliz at gnu dot org>
- Date: Mon, 21 Jun 2010 09:57:14 -0700
- Subject: Re: [RFC] Let "gcore" command accept a suffix argument
- References: <daef60381001040642h2e8b3919u221f61d43b23d395@mail.gmail.com> <daef60381001052257q2068a8fbmaacd026b8d5cef49@mail.gmail.com> <20100106075757.GF24777@adacore.com> <daef60381001090154m36f5cf15x9f76b7073e4d126@mail.gmail.com> <20100109105557.GA2007@adacore.com> <daef60381001090717j4a658548g114950986df6279b@mail.gmail.com> <20100110054328.GD2007@adacore.com> <daef60381001100530k39fe9727s355cad73a47a2989@mail.gmail.com> <20100110140029.GF2007@adacore.com> <AANLkTinVPdwg6HuAp08wknw8DYe80LcR33tbEaRkMDXz@mail.gmail.com>
> 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