From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20931 invoked by alias); 18 Apr 2019 15:23:53 -0000 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 Received: (qmail 20714 invoked by uid 89); 18 Apr 2019 15:23:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-12.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=merely, his, HContent-Transfer-Encoding:8bit X-HELO: relay.fit.cvut.cz Received: from relay.fit.cvut.cz (HELO relay.fit.cvut.cz) (147.32.232.237) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Apr 2019 15:23:52 +0000 Received: from imap.fit.cvut.cz (imap.fit.cvut.cz [147.32.232.238]) by relay.fit.cvut.cz (8.15.2/8.15.2) with ESMTPS id x3IFNlvu093685 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Apr 2019 17:23:48 +0200 (CEST) (envelope-from jan.vrany@fit.cvut.cz) Received: from localhost (02d97c6d.bb.sky.com [2.217.124.109] (may be forged)) (authenticated bits=0 as user vranyj1) by imap.fit.cvut.cz (8.15.2/8.15.2) with ESMTPSA id x3IFNkem060277 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 18 Apr 2019 17:23:47 +0200 (CEST) (envelope-from jan.vrany@fit.cvut.cz) From: Jan Vrany To: gdb-patches@sourceware.org Cc: Jan Vrany Subject: [RFC 0/8] Create MI commands using python Date: Thu, 18 Apr 2019 15:23:00 -0000 Message-Id: <20190418152337.6376-1-jan.vrany@fit.cvut.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SW-Source: 2019-04/txt/msg00328.txt.bz2 This patch series adds a possibility to create new MI commands using python. The code is based on a few year old attempt of Didier Nadeau who did the heavy lifting. I merely updated his original code to work with today's GDB, add tests and polished it a little. At this point, there's no documentation. I expect a discussion and changes in behavior and/or output - I'll write it once the rest is agreed on. Didier Nadeau (3): Use std::map for MI commands in mi-cmds.c Use classes to represent MI Command instead of structures Create MI commands using python. Jan Vrany (5): mi/python: C++ify python MI command handling code mi/python: Polish MI output of python commands mi/python: Handle python exception when executiong python-defined MI commands mi/python: Add tests for python-defined MI commands mi/python: Allow redefinition of python MI commands gdb/ChangeLog | 31 ++ gdb/Makefile.in | 1 + gdb/mi/mi-cmd-info.c | 4 +- gdb/mi/mi-cmds.c | 537 +++++++++++++----------- gdb/mi/mi-cmds.h | 94 ++++- gdb/mi/mi-main.c | 18 +- gdb/mi/mi-main.h | 1 + gdb/mi/mi-parse.c | 20 +- gdb/mi/mi-parse.h | 6 +- gdb/python/py-micmd.c | 300 +++++++++++++ gdb/python/py-micmd.h | 6 + gdb/python/python-internal.h | 2 + gdb/python/python.c | 3 +- gdb/testsuite/ChangeLog | 11 + gdb/testsuite/gdb.python/py-mi-cmd-1.py | 27 ++ gdb/testsuite/gdb.python/py-mi-cmd-2.py | 13 + gdb/testsuite/gdb.python/py-mi-cmd.exp | 77 ++++ 17 files changed, 851 insertions(+), 300 deletions(-) create mode 100644 gdb/python/py-micmd.c create mode 100644 gdb/python/py-micmd.h create mode 100644 gdb/testsuite/gdb.python/py-mi-cmd-1.py create mode 100644 gdb/testsuite/gdb.python/py-mi-cmd-2.py create mode 100644 gdb/testsuite/gdb.python/py-mi-cmd.exp -- 2.20.1