Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Yakov Lerner" <iler.ml@gmail.com>
To: "Michael Snyder" <msnyder@specifix.com>, gdb-patches@sourceware.org
Subject: Re: simlpe patch implements eval command (with printf-like format and args)
Date: Thu, 21 Feb 2008 22:50:00 -0000	[thread overview]
Message-ID: <f36b08ee0802211437t1e01a7abq8811b4fe29982b7b@mail.gmail.com> (raw)
In-Reply-To: <1203631895.19253.213.camel@localhost.localdomain>

On Fri, Feb 22, 2008 at 12:11 AM, Michael Snyder <msnyder@specifix.com> wrote:
>
> On Thu, 2008-02-21 at 11:20 +0200, Yakov Lerner wrote:
> > This simple patch implements eval command with printf-like syntax:
> >
> >         eval "printf-like-format", comma-separated args
> >
> > The patch is  against cvs-checkedout source. Suggestions are welcome.
> > Implementation is very simple.
>
> Not bad at all, for a first contribution.  But I suggest
> you try to limit the scope a little bit and make it still
> simpler -- maybe have it accept only strings, floats and ints
> to start -- and see if you can't implement it less intrusively

You mean here, to replicate (with cuts) the code of existing
printf_command(), and leave existing printf_command()
unchanged, correct ?

> eg. without taking over the function for another command and
> introducing new cross-module infrastructure.  Then we can
> maybe iteratively improve on it.
>
> I'll give you some style and structure feedback on this one:
> >
> > +/* Grow allocated buffer and appens to it, without causing quadratic
> > slowdown */
>
> "append", of course -- and comments must be punctuated (in this case,
> period followed by two spaces".  Plus indentation -- consult the GNU
> coding standard.

ok

> > +/* Grow allocated buffer and appens to it, without causing quadratic
> > slowdown */
>
> as above.

ok

> > +static void
> > +eval_command (char *arg, int from_tty)
> > +{
> > +  struct cleanup *old_cleanups;
> > +  char *str = gdb_own_xasprintf (arg);
> > +
> > +  old_cleanups = make_cleanup (free_current_contents, &str);
> > +  execute_command (str, from_tty);
> > +  do_cleanups (old_chain);
> > +}
>
> old_chain is undefined.  Probably should be "old_cleanups"?

ok

Thanks
Yakov


  reply	other threads:[~2008-02-21 22:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-21 17:33 Yakov Lerner
2008-02-21 22:37 ` Michael Snyder
2008-02-21 22:50   ` Yakov Lerner [this message]
2008-02-21 22:56     ` Michael Snyder
2008-02-22  9:59 ` Daniel Jacobowitz
2008-02-22 11:17   ` Yakov Lerner
2008-02-22 17:12 ` Eli Zaretskii
2008-02-24 15:39   ` Yakov Lerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f36b08ee0802211437t1e01a7abq8811b4fe29982b7b@mail.gmail.com \
    --to=iler.ml@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@specifix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox