From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18154 invoked by alias); 28 Aug 2011 10:34:30 -0000 Received: (qmail 17867 invoked by uid 22791); 28 Aug 2011 10:34:29 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 28 Aug 2011 10:34:16 +0000 From: "ratmice at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug python/11688] wrap MI commands in python Date: Mon, 29 Aug 2011 21:06:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ratmice at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 7.1 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2011-q3/txt/msg00256.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=11688 --- Comment #3 from matt rice 2011-08-28 10:33:56 UTC --- So I guess i changed my mind about working on this, with my main motivation being that it might make an ok alternative wire format to mi for an interface, e.g. using python on the client side with eval, dodging an mi parser all-together... something like this, with print repr on the gdb side, and eval on the client side... seems worth experimenting with anyways. (gdb) py print eval(repr(gdb.mi_execute('break-insert', 'main'))) {'bkpt': {'disp': 'keep', 'file': 'test.c', 'number': 3, 'func': 'main', 'line': 34, 'original-location': 'main', 'addr': '0x0000000000400509', 'enabled': 'y', 'times': 0, 'fullname': '/home/ratmice/tests/test.c', 'type': 'breakpoint'}} i've pretty much redone the python mi_execute command, to be less of a hack and managed to coax it into outputting dictionaries, or lists instead of lists of lists or tuples, i think its nicer... (gdb) py stuff.append(gdb.mi_execute("break-insert", "main")) (gdb) py x = stuff[-1]['bkpt']['number'] (gdb) py gdb.mi_execute("break-after", (x, 76)) (gdb) py print x 3 (gdb) info b 3 Num Type Disp Enb Address What 3 breakpoint keep y 0x0000000000400509 in main at test.c:34 ignore next 76 hits -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.