public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Add new command to create extra console/mi UIs
@ 2016-06-21 18:51 sergiodj+buildbot
  2016-06-21 18:50 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master sergiodj+buildbot
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: sergiodj+buildbot @ 2016-06-21 18:51 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT 60eb5395fa7a7b8e3cd1841e38b6d1a0c16be0d0 ***

Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 60eb5395fa7a7b8e3cd1841e38b6d1a0c16be0d0

Add new command to create extra console/mi UIs

With all the previous plumbing in place, it's now easy to add a
command that actually creates a new console/mi UI.

The intended use case is to make it possible and easy for MI frontends
to provide a fully featured GDB console to users, with readline
support, command line editing, history, etc., just like if gdb was
started on the command line.  Currently MI frontends have to try to
implement all of that theirselves and make use of "-interpreter-exec
console ...", which is far from perfect.  If you ever tried Eclipse's
gdb console window, you'll know what I mean...

Instead of trying to multiplex console through MI, this command let's
just leverage all the built in readline/editing support already inside
gdb.

The plan is for the MI frontend to start GDB in regular console mode,
running inside a terminal emulator widget embedded in Eclipse (which
already exists, for supporting the shell widget; other frontends have
similar widgets), and then tell GDB to run a full MI interpreter on an
specified input/output device, independent of the console.

My original prototype planned to do things the other way around --
start GDB in MI mode, and then start an extra CLI console on separate
tty.  I handed over that prototype to Marc Khouzam @ Eclipse CDT, and
after experimentation and discussion, we ended up concluding that
starting GDB in CLI mode instead was both easier and actually also
supported an interesting use case -- connect an Eclipse frontend to a
GDB that is already running outside Eclipse.

The current usage is "new-ui <interpreter> <tty>".

E.g., on a terminal run this scriplet:

 $ cat gdb-client
 #!/bin/bash

 reset
 tty
 tail -f /dev/null

 $ gdb-client
 /dev/pts/15

Now run gdb on another terminal, and tell it to start a MI interpreter
on the tty of the other terminal:

 ...
 (gdb) new-ui mi /dev/pts/15
 New UI allocated

Now back to the the gdb-client terminal, we'll get an MI prompt, ready
for MI input:

 /dev/pts/15
 =thread-group-added,id="i1"
 (gdb)

You can also start a new UI running a CLI, with:

 (gdb) new-ui console /dev/pts/15

Though note that this console won't support readline command editing.
It works as if "set editing off" was entered.

gdb/ChangeLog:
2016-06-21  Pedro Alves  <palves@redhat.com>

	* interps.c (set_top_level_interpreter): New function, factored
	out from captured_main.
	(interpreter_completer): Make extern.
	* interps.h (set_top_level_interpreter, interpreter_completer):
	New declarations.
	(captured_main): Use set_top_level_interpreter.
	* top.c [!O_NOCTTY] (O_NOCTTY): Define as 0.
	(open_terminal_stream, new_ui_command): New functions.
	(init_main): Install the "new-ui" command.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-06-23 18:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-21 18:51 [binutils-gdb] Add new command to create extra console/mi UIs sergiodj+buildbot
2016-06-21 18:50 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master sergiodj+buildbot
2016-06-22  9:22 ` Failures on Debian-i686, " sergiodj+buildbot
2016-06-22 11:00 ` Failures on Debian-i686-native-extended-gdbserver, " sergiodj+buildbot
2016-06-22 22:59 ` Failures on Debian-x86_64-m64, " sergiodj+buildbot
2016-06-22 23:28 ` Failures on Debian-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2016-06-23 12:44 ` Failures on Fedora-ppc64be-cc-with-index, " sergiodj+buildbot
2016-06-23 13:39 ` Failures on Fedora-ppc64be-native-gdbserver-m64, " sergiodj+buildbot
2016-06-23 14:21 ` Failures on Fedora-ppc64be-native-extended-gdbserver-m64, " sergiodj+buildbot
2016-06-23 17:53 ` Failures on Fedora-ppc64le-native-extended-gdbserver-m64, " sergiodj+buildbot
2016-06-23 18:34 ` Failures on Fedora-ppc64le-native-gdbserver-m64, " sergiodj+buildbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).