From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36797 invoked by alias); 19 Jan 2017 15:40:31 -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 34510 invoked by uid 89); 19 Jan 2017 15:40:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_40,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*r:may, H*r:forged, H*r:UNKNOWN, H*r:sk:gdb@sou 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, 19 Jan 2017 15:40:28 +0000 Received: from imap.fit.cvut.cz (imap.fit.cvut.cz [IPv6:2001:718:2:2901:0:0:0:238] (may be forged)) by relay.fit.cvut.cz (8.15.2/8.15.2) with ESMTPS id v0JFeJBQ086434 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK) for ; Thu, 19 Jan 2017 16:40:19 +0100 (CET) (envelope-from jan.vrany@fit.cvut.cz) Received: from UNKNOWN (0279548f.bb.sky.com [2.121.84.143] (may be forged)) (authenticated bits=0 as user vranyj1) by imap.fit.cvut.cz (8.15.2/8.15.2) with ESMTPSA id v0JFeD4X050909 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 19 Jan 2017 16:40:18 +0100 (CET) (envelope-from jan.vrany@fit.cvut.cz) Message-ID: <1484840408.10710.1.camel@fit.cvut.cz> Subject: Re: GDB/MI questions From: Jan Vrany To: gdb@sourceware.org Date: Thu, 19 Jan 2017 15:40:00 -0000 In-Reply-To: References: <20170119031445.GA24616@xubuntu.brasko.net> ,<20170119151120.GB6289@xubuntu.brasko.net> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-FIT-MailScanner-ID: v0JFeJBQ086434 X-FIT-MailScanner: Found to be clean X-FIT-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0.01, required 7, autolearn=not spam, RP_MATCHES_RCVD 0.01) X-FIT-MailScanner-From: jan.vrany@fit.cvut.cz X-FIT-MailScanner-Watermark: 1485445219.95331@SkJDcAzjpDu5AASKcyyd9Q X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00035.txt.bz2 On Thu, 2017-01-19 at 15:24 +0000, Marc Khouzam wrote: > > On Thu, Jan 19, 2017 at 02:30:58PM +0000, Marc Khouzam wrote: > > > > Second, from the CLI if you run the command "next", then if you > > > > hit > > > > the enter key, GDB will run the "next" command again. > > > > However, in GDB/MI if you run -interpreter-exec console "next", > > > > and then > > > > follow that with the Enter key, GDB does nothing. > > > > Is there a way to run the last command? > > > > ... > > > > > But if you really want that for some reason, you can just keep > > > track > > > of the last command you sent in MI, and then when getting an lone > > > Enter, you could send it again.  But then you don't have the > > > smarts > > > of GDB to know which commands should repeat and which should not. > > > I don't think this is a very good idea. > > > > I'm just trying to provide the same functionality I did when I was > > using > > annotations. This was one of the noted differences. > > > > Since the MI differs in this area, I've done as you suggested and > > that works well. I guess I'll see if there are any downsides here. > > For the record, I'll add my voice to Pedro's suggestion to try out > the 'new-ui' command and have a separate MI channel from your CLI. > That is such a better user experience. > And it shouldn't be very hard to implement in your frontend since > you were previously handling a GDB CLI anyway. > > FYI, Eclipse launches GDB in CLI mode (probably like you did before) > and let's the user interact with that CLI, while it sends MI commands > on the > dedicated PTY for the MI channel. > > Here is the parameters eclipse uses to launch such a GDB: > > gdb.7.12 --nx -q -ex "new-ui mi " -ex "set pagination off" > -ex show version Would it work the other way round? I mean starting in MI mode and then do something like -new-ui console /dev/some/pty ? This looks more "natural" to me. Jan > > Note that the "-q" command along with the last two -ex commands are > to make  > sure GDB does not paginate before creating the MI channel, in case > the terminal is  > too small to even show the version. > > One very important note if you use the new-ui feature, is that you > need to run > mi-async because the MI channel does not accept ^C, so you need to > use > -exec-interrupt instead.   > > Also, it will probably need a bit more work if you target Windows. > > Marc > >