From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21696 invoked by alias); 13 Mar 2008 06:12:09 -0000 Received: (qmail 21687 invoked by uid 22791); 13 Mar 2008 06:12:09 -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; Thu, 13 Mar 2008 06:11:51 +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 m2D6Bj2Y013694 for ; Thu, 13 Mar 2008 02:11:45 -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 m2D6Bjms028140 for ; Thu, 13 Mar 2008 02:11:45 -0400 Received: from opsy.redhat.com (vpn-248-14.boston.redhat.com [10.13.248.14]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2D6BiH0031953; Thu, 13 Mar 2008 02:11:45 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 970D1888117; Wed, 12 Mar 2008 23:19:49 -0600 (MDT) To: gdb-patches@sourceware.org Subject: Re: [RFC] Strings and arrays without malloc References: <20080309161335.GA26917@caradoc.them.org> From: Tom Tromey Reply-To: Tom Tromey X-Attribution: Tom Date: Thu, 13 Mar 2008 06:12:00 -0000 In-Reply-To: (Tom Tromey's message of "Tue\, 11 Mar 2008 00\:06\:56 -0600") 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-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-03/txt/msg00139.txt.bz2 Tom> In the end I think it would be preferable to just use Python for all Tom> this stuff. That way all the access code only needs to be done once. Tom> IMO the $(...) syntax should simply eval the contents as a Python Tom> expression. Tonight I grabbed Volodya's branch and reworked the convenience function patch to use python for everything. I also added a couple convenience functions for python -- one to access set/show variables, and one to run any gdb command (maybe the latter should be done via the MI interpreter? I'm using the CLI). (Note that the set/show thing means that code like the "info args" thing we were discussing recently needs to be cleaned up to work properly.) This all works great. I'm not completely happy about the extra syntax (python requires more quoting and parentheses than we would with a completely custom-for-gdb language), but I think I'll just end up defining a bunch of helper code in python to make the user command lines short. I guess the next step to getting something actually useful is to expose selected parts of gdb internals to python. First I'm thinking frame information... my current thinking is that the general approach should be to write a thin binding, and then add a nicer OO API in pure python. I'm not a python person though, so maybe this is weird. Opinions, advice, encouragement, etc ... all welcome. At times I suspect that nobody is reading this. Tom