From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id DA05C3858402 for ; Tue, 2 Nov 2021 19:11:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DA05C3858402 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52124) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhzBc-0005kc-ES for gdb@sourceware.org; Tue, 02 Nov 2021 15:11:08 -0400 Received: from ip5f5a8d68.dynamic.kabel-deutschland.de ([95.90.141.104]:49605 helo=[192.168.111.41]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhzBb-0004o9-3R for gdb@sourceware.org; Tue, 02 Nov 2021 15:11:07 -0400 To: gdb@sourceware.org References: <60c53fa8bf160533a2eddf1da280eb50c7461a6a.camel@fit.cvut.cz> From: Simon Sobisch Subject: Re: How to create new mi commands via python / get current interpreter in python Message-ID: <253b903c-b5e3-86bd-2681-c904fb2c5d53@gnu.org> Date: Tue, 2 Nov 2021 20:11:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <60c53fa8bf160533a2eddf1da280eb50c7461a6a.camel@fit.cvut.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2021 19:11:11 -0000 That's exactly I was looking for, so sad that this isn't available in GDB 11 :-( In any case that looks quite promising, would be nice to see it at least in a feature-branch in the official gdb repo until it is ready to be merged. For the "hack without a patched GDB version": do you know of a good way to create the mi-expected message with different parameters in plain python and/or a way to know which interpreter is active in the current context of a gdb.Command? Simon Am 02.11.2021 um 17:56 schrieb Jan Vrany: > Hi, > > On Tue, 2021-11-02 at 17:40 +0100, Simon Sobisch via Gdb wrote: >> Additional to this question: is there an option to create new MI >> commands from python (instead of "console commands") > > Sort of. This has been started by Didier Nadeau and then continued by > me but sadly, I got carried away and have not done the last bits so it > can be pushed. > > However, I'm using this feature heavily and keep more-or-less > up-to-date GDB with this support (and some other hacks/fixes waiting > to be polished and submitted, see > > https://github.com/janvrany/binutils-gdb/tree/users/jv%2Fvdb > > Here you may find example how I use it: > > https://swing.fit.cvut.cz/hg/jv-vdb/file/tip/python/vdb/__init__.py#l329 > > Let me know if you have any questions, let me know. > > I'd like to take the opportunity and apologise to all reviewers > for not finishing it yet - hopefuly I'll find long-enough period of > quiter time to finish this. > > Jan > >