From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8+2rKGiNgWFnIgAAWB0awg (envelope-from ) for ; Tue, 02 Nov 2021 15:11:36 -0400 Received: by simark.ca (Postfix, from userid 112) id 9E1461F0C1; Tue, 2 Nov 2021 15:11:36 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id CE7771E940 for ; Tue, 2 Nov 2021 15:11:35 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 14F35385803B for ; Tue, 2 Nov 2021 19:11:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14F35385803B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1635880295; bh=zw9xonhLZtHOuHP9nCh0siGjyCBI/xotxgHX+Aof5kE=; h=To:References:Subject:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=iG0ZfUMEVM670AlSEfRAcE6u/Yz+C7I+oHBV2085fJX9BNH+G/kz5n/II9creamPQ +Rqub0QdvgqanyhEQ5PTMl79B8CtBTiGaLuTJK7HId4JbZ377l9m/NMQ5TWd7bp0kS PoKmGuqTNZQOfysTnA5JnCTCqbJYAZkkhS65XfEc= 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> 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-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: , From: Simon Sobisch via Gdb Reply-To: Simon Sobisch Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" 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 > >