From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20618 invoked by alias); 21 Feb 2008 22:50:45 -0000 Received: (qmail 20516 invoked by uid 22791); 21 Feb 2008 22:50:44 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 21 Feb 2008 22:50:26 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 445D83BCCF; Thu, 21 Feb 2008 14:50:24 -0800 (PST) Subject: Re: simlpe patch implements eval command (with printf-like format and args) From: Michael Snyder To: Yakov Lerner Cc: gdb-patches@sourceware.org In-Reply-To: References: <1203631895.19253.213.camel@localhost.localdomain> Content-Type: text/plain Date: Thu, 21 Feb 2008 22:56:00 -0000 Message-Id: <1203634223.19253.221.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00354.txt.bz2 On Fri, 2008-02-22 at 00:37 +0200, Yakov Lerner wrote: > On Fri, Feb 22, 2008 at 12:11 AM, Michael Snyder 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...