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: simlpe patch implements eval command (with printf-like format and args)


On Fri, 2008-02-22 at 00:37 +0200, Yakov Lerner wrote:
> 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 ?

That is in fact what I meant, but now I'm having second thoughts.
It's just that you're modifying print_command quite a lot.

If you factored out the grow/append functionality, could you
do it with more minimal changes to printf_command (or to, say, 
printf_command_core()?)

Aside, is there any reason to put the new command in source.c?
Why not keep the code close together by putting it in printcmd.c?
Doesn't seem like it's directly related to source files...



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