From: Pedro Alves <palves@redhat.com>
To: Jan Vrany <jan.vrany@fit.cvut.cz>, gdb@sourceware.org
Subject: Re: GDB/MI questions
Date: Thu, 19 Jan 2017 16:17:00 -0000 [thread overview]
Message-ID: <27ac7a10-40d6-d636-995c-7153cac4fe3d@redhat.com> (raw)
In-Reply-To: <1484840408.10710.1.camel@fit.cvut.cz>
On 01/19/2017 03:40 PM, Jan Vrany wrote:
> 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 <some pty>" -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.
That was the original plan for Eclipse, but doing it the other
way around turned out to be much simpler. The command works
and you do get a console on /dev/some/pty, but readline won't
be active on that console, so it's not the same thing.
Also, ctrl-c's in that "secondary" UI likely don't reach gdb
automatically. Likely we'd need some thin signal forwarding
gdb agent running on that terminal, plus some other bits of
coordination ("gdb is gone", SIGWINCH/"screen size changed", etc.)
Something similar to emacsclient.
If you start gdb in console mode in the terminal widget, then
it all Just Works. GDB has no idea it's running inside a GUI
at all. It's just another terminal emulator, so the
experience is 100% like that of on "the normal command line".
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-01-19 16:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170119031445.GA24616@xubuntu.brasko.net>
2017-01-19 14:31 ` Marc Khouzam
2017-01-19 14:52 ` Bob Rossi
2017-01-19 15:06 ` Pedro Alves
2017-01-19 15:11 ` Bob Rossi
2017-01-19 15:24 ` Marc Khouzam
2017-01-19 15:40 ` Jan Vrany
2017-01-19 16:17 ` Pedro Alves [this message]
2017-01-19 15:47 ` Simon Marchi
2017-01-19 16:03 ` Bob Rossi
2017-01-19 16:15 ` Simon Marchi
2017-01-19 16:27 ` Bob Rossi
2017-01-19 16:33 ` Pedro Alves
2017-01-19 14:43 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27ac7a10-40d6-d636-995c-7153cac4fe3d@redhat.com \
--to=palves@redhat.com \
--cc=gdb@sourceware.org \
--cc=jan.vrany@fit.cvut.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox