From: Jim Blandy <jimb@redhat.com>
To: Nick Roberts <nick@nick.uklinux.net>
Cc: rms@gnu.org, gdb@sources.redhat.com
Subject: Re: obsoleting the annotate level 2 interface
Date: Tue, 28 Jan 2003 20:51:00 -0000 [thread overview]
Message-ID: <vt27kcprojq.fsf@zenia.red-bean.com> (raw)
In-Reply-To: <15917.39229.935851.920452@nick.uklinux.net>
Nick, what is involved in bringing gdb-ui over to using MI?
Annotations have been deprecated for a while now, so it probably won't
kill us to keep them for a while longer, but it doesn't make sense for
us to keep them indefinitely; gdb-ui needs to start making the
transition.
Keep in mind, I haven't been taking part of all these conversations
about MI, Eclipse, and the rest, so I don't know the whole history of
what was broken when, who was unhelpful to whom, etc. But from what I
do understand, I really think MI is the way GDB should go. I'd like
to help make that happen.
Personally, I want a command-line interface to GDB too; I'd like to
see MI used to improve that (say, by handling 'display' or the
breakpoint list better), but I don't want to replace it. What is MI
missing in this regard? It seems to me like it's all there:
zenia:emacs$ $D6/gdb/gdb --interpreter=mi2 $D6/gdb/gdb
~"GNU gdb 2003-01-23-cvs\n"
~"Copyright 2003 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you are\n"
~"welcome to change it and/or distribute copies of it under certain conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-linux-gnu\"..."
~"\n"
(gdb)
break symfile.c:1234
&"break symfile.c:1234\n"
^done
(gdb)
print annotation_level
&"print annotation_level\n"
~"$1 = 0"
~"\n"
^done
(gdb)
In other words, you can just send the user's input to an MI GDB
directly, and whatever you get back prefixed with a ~ is what should
go into the interaction buffer as GDB's output.
One problem is that even command-line commands produce output in MI
style: whether I say "info breakpoints" (the CLI command) or
"-break-list" (the MI command), I get MI-style output:
(gdb)
-break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x080b183c",func="symbol_file_command",file="/home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/symfile.c",line="1234",times="0"}]}
(gdb)
info breakpoints
&"info breakpoints\n"
^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x080b183c",func="symbol_file_command",file="/home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/symfile.c",line="1234",times="0"}]}
(gdb)
But I think this could be handled by having a cli ui_out stream built
on top of the default MI ui_out stream, and setting the global uiout
to that while running a command-line command. That way, you'd get
CLI-style output wrapped up as an MI-style ~ packet.
For completion, can't gdb-ui.el continue to use the "complete"
command, just as Emacs always has?
(gdb)
complete break symfi
&"complete break symfi\n"
~"break symfile_bfd\n"
~"break symfile_bfd_open\n"
~"break symfile_complaint_book\n"
~"break symfile_complaints\n"
~"break symfile_explanations\n"
~"break symfile_objfile\n"
~"break symfile_relocatable\n"
^done
(gdb)
There's also the issue of having the program's output interleaved with
GDB's. But you can use GDB's `tty' command to send the inferior's
output to any pseudotty you like --- you could put it in a separate
buffer from the GDB interaction, or you could copy it into the GDB
interaction buffer if that's what you want.
What are the other issues?
This may not be the largest issue, but one thing that might be of
interest is that, given the way the MI support is done, it would be
very easy to have GDB provide all its output as Emacs Lisp
s-expressions, so Emacs could just 'read' them directly. And this
would be a modular and relatively small change. All you need to do is
provide your own `struct ui_out_impl' that prints things the way you
like.
next prev parent reply other threads:[~2003-01-28 20:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-21 7:38 Jim Blandy
2003-01-21 16:15 ` Andrew Cagney
2003-01-21 16:54 ` David Carlton
2003-01-21 19:04 ` Eli Zaretskii
2003-01-22 8:37 ` Pierre Muller
2003-01-22 15:06 ` Elena Zannoni
[not found] ` <15917.39229.935851.920452@nick.uklinux.net>
2003-01-28 20:51 ` Jim Blandy [this message]
2003-01-29 1:41 ` Nick Roberts
2003-01-29 5:37 ` Andrew Cagney
2003-01-29 5:40 ` Andrew Cagney
2003-01-29 21:58 ` Jim Blandy
2003-01-29 22:00 ` Arnaud Charlet
2003-01-29 22:50 ` Andrew Cagney
2003-01-29 21:52 ` Jim Blandy
2003-01-21 17:41 Michael Elizabeth Chastain
2003-01-21 20:25 ` David Carlton
2003-01-22 16:45 ` Andrew Cagney
2003-01-21 18:09 Michael Elizabeth Chastain
2003-01-22 7:56 ` Arnaud Charlet
[not found] <1043140716.4941.ezmlm@sources.redhat.com>
2003-01-21 19:03 ` Jim Ingham
2003-01-21 20:40 Michael Elizabeth Chastain
2003-02-04 1:45 Mike Mueller
2003-02-04 6:58 ` Andrew Cagney
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=vt27kcprojq.fsf@zenia.red-bean.com \
--to=jimb@redhat.com \
--cc=gdb@sources.redhat.com \
--cc=nick@nick.uklinux.net \
--cc=rms@gnu.org \
/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