From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32490 invoked by alias); 15 Feb 2008 17:59:11 -0000 Received: (qmail 32482 invoked by uid 22791); 15 Feb 2008 17:59:11 -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; Fri, 15 Feb 2008 17:58:51 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 611223BF52; Fri, 15 Feb 2008 09:58:49 -0800 (PST) Subject: Re: implementing eval command From: Michael Snyder To: Yakov Lerner Cc: gdb@sourceware.org In-Reply-To: References: Content-Type: text/plain Date: Fri, 15 Feb 2008 17:59:00 -0000 Message-Id: <1203098329.19253.133.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-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00109.txt.bz2 Moving this to "gdb" list, since it is not a patch. On Thu, 2008-02-14 at 18:18 +0200, Yakov Lerner wrote: > I'd like to make a patch that implements eval command, as follows. > I have following idea to implement eval simply: > Syntax of eval will be similar to the syntax of 'printf' command: > eval "string with %..." comma-separated-expressions > Implementation relies on existing printf_command() function, > by rewriting printf_command into pair of functions, one that computes > result of printf as allocated string; both printf_command and eval_command > will use compute_printf() function. > What do you think ? Hmmm, that would be one way of getting around the limitations of some commands that can't accept expressions as arguments (mentioned in another thread). What do you see as the context for this eval command? How do you imagine it will be used?