From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32385 invoked by alias); 25 Mar 2008 19:31:46 -0000 Received: (qmail 32375 invoked by uid 22791); 25 Mar 2008 19:31:46 -0000 X-Spam-Check-By: sourceware.org Received: from aussmtpmrkpc120.us.dell.com (HELO aussmtpmrkpc120.us.dell.com) (143.166.82.159) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 25 Mar 2008 19:31:25 +0000 X-IronPort-AV: E=Sophos;i="4.25,553,1199685600"; d="scan'208";a="337840965" Received: from unknown (HELO M31.equallogic.com) ([12.110.134.31]) by aussmtpmrkpc120.us.dell.com with SMTP; 25 Mar 2008 14:31:23 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18409.21257.48822.645806@pkoning-laptop.equallogic.com> Date: Tue, 25 Mar 2008 20:31:00 -0000 From: Paul Koning To: tromey@redhat.com 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> X-Mailer: VM 7.17 under 21.4 (patch 19) "Constant Variable" XEmacs Lucid 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-03/txt/msg00228.txt.bz2 >>>>> "Tom" == Tom Tromey writes: Tom> The basic problem is that we have a syntax for embedding a Tom> python call in an expression that looks like $(stuff). Tom> Now, internally to gdb, "stuff" is just a string. But, most of Tom> the time, the implementation of this function, whatever it is, Tom> won't want just a string -- it will want an expression, or a Tom> file name, or something. Tom> So, what Jim and Daniel want, I think, is a declarative way for Tom> the Python code (which implements the given function) to tell Tom> gdb's core how to parse this string. Something akin to the way that C extension modules inside Python tell the Python execution machinery what data type it wants might serve. The notion of asking for a particular type is a bit foreign to Python; arguments have no fixed type. Another possibility is to pass strings but then have standard conversion routines (things callable by Python and supplied by gdb). For example parse_and_eval_address. And the target functions. And so on. def walklist (head): addr = parse_and_eval_address (head) while addr: print "list item at", addr addr = target_read_memory (addr, 4) paul