From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26284 invoked by alias); 25 Mar 2008 19:18:31 -0000 Received: (qmail 26273 invoked by uid 22791); 25 Mar 2008 19:18:30 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 25 Mar 2008 19:18:12 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m2PJI6VG010577; Tue, 25 Mar 2008 15:18:06 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2PJI5hq028867; Tue, 25 Mar 2008 15:18:05 -0400 Received: from opsy.redhat.com (vpn-14-254.rdu.redhat.com [10.11.14.254]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2PJI5Vr013817; Tue, 25 Mar 2008 15:18:05 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 44F34508244; Tue, 25 Mar 2008 12:22:27 -0600 (MDT) To: Paul Koning Cc: jimb@red-bean.com, bauerman@br.ibm.com, gdb@sourceware.org Subject: Re: repo to work on python scripting support References: <1205538908.6643.138.camel@localhost.localdomain> <1206369478.29533.15.camel@localhost.localdomain> <20080325114520.GA21688@caradoc.them.org> <8f2776cb0803251118o316d261erb340d67bb0580967@mail.gmail.com> <18409.18988.613477.542099@pkoning-laptop.equallogic.com> From: Tom Tromey Reply-To: Tom Tromey X-Attribution: Tom Date: Tue, 25 Mar 2008 20:18:00 -0000 In-Reply-To: <18409.18988.613477.542099@pkoning-laptop.equallogic.com> (Paul Koning's message of "Tue\, 25 Mar 2008 14\:53\:32 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-03/txt/msg00227.txt.bz2 >>>>> "Paul" == Paul Koning writes: Paul> An obvious Pythonic way of doing this is with default arguments, which Paul> allows a call to omit some of the arguments defined for the function. Paul> For example: Paul> def foo (arg1, arg2=None): Paul> if arg2 is None: Paul> arg2 = raw_input ("please supply arg2: ") I think default arguments are part of the solution, but not the whole solution. The basic problem is that we have a syntax for embedding a python call in an expression that looks like $(stuff). Now, internally to gdb, "stuff" is just a string. But, most of the time, the implementation of this function, whatever it is, won't want just a string -- it will want an expression, or a file name, or something. So, what Jim and Daniel want, I think, is a declarative way for the Python code (which implements the given function) to tell gdb's core how to parse this string. I think the hope here is that we avoid the mess of gdb commands, which really do get just a plain string and then proceed to be inconsistent with each other and just generally hard to modify. It would be interesting to see if we could enumerate the core possibilities for argument types. Tom