From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12121 invoked by alias); 3 Sep 2013 21:25:11 -0000 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 Received: (qmail 12109 invoked by uid 89); 3 Sep 2013 21:25:11 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Sep 2013 21:25:11 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r83LP7Wb008362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 Sep 2013 17:25:07 -0400 Received: from localhost.localdomain (ovpn-112-21.ams2.redhat.com [10.36.112.21]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r83LP5GO014159; Tue, 3 Sep 2013 17:25:06 -0400 Message-ID: <522653B0.1070807@redhat.com> Date: Tue, 03 Sep 2013 21:25:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Bob Rossi CC: Tom Tromey , gdb@sourceware.org Subject: Re: gdb/mi or python interface for front end References: <20130823005118.GA8847@bob-VirtualBox> <87eh9ka4i8.fsf@fleche.redhat.com> <20130903012929.GA4379@bob-VirtualBox> In-Reply-To: <20130903012929.GA4379@bob-VirtualBox> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00001.txt.bz2 On 03/09/13 02:29, Bob Rossi wrote: > On Fri, Aug 23, 2013 at 08:03:27AM -0600, Tom Tromey wrote: >> Bob> I would like some advice. It currently uses annotate level 2 >> Bob> for communication. Should I look into gdb/mi or should i look >> Bob> into scripting gdb with the python interface? >> >> Definitely stop using annotations. > > In the process. Sorry I missed this email. I must have been on PTO and it slipped through. Yes, agreed, annotations must die! ;) >> I think using Python is cool, but I must admit it has a couple of >> potential drawbacks. First, it limits the versions of gdb your tool can >> use -- older gdbs do not have Python, and it is an optional feature >> (though most distros build it in). > > Which is why I'm still using annotations. Although that argument is > getting older. It's my goal to be able to make the Python API able to do what you wish, but there are some gaps. For example, we don't have asynchronous and rich inferior control. That will come, hopefully sooner than later. You can get around it pretty much right now with gdb.parse_and_eval and other like commands, but the feedback is all text, which is problematic (text changes, as do error messages, and there is no mark-up). Soon, I hope, I will write inferior control into the Python API. >> Also, it is not as complete as MI in >> some ways, so you may encounter holes that you need to be filled before >> you can implement some feature. > > I'd like to avoid that. MI is pretty much designed to be a complement for IDEs/UIs as it uses the concept of a wire protocol to communicate with GDB. My goal with the Python API is to make the API better suited to specific goals of tools that use GDB for a narrower focus. So you can write specific tool-based solutions using it, instead of the catch all focus of the IDE. I don't think it is worthwhile to write the Python API to replace MI; MI is a known quantity used for this very purpose. That being said, if you can write an entire front-end with Python, then I would consider that an end-goal of the Python API. > I might end up with a hybrid approach. Bubble up my MI protocol and > also support python programming. I'm going to dig deeper at some point > in the future on this one. If I can help you on your approach, I would be happy to help. Either on the mailing list, or on the #gdb irc channel on freenode. Cheers, Phil