Mirror of the gdb mailing list
 help / color / mirror / Atom feed
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: Wed, 29 Jan 2003 21:52:00 -0000	[thread overview]
Message-ID: <vt2y953mxwb.fsf@zenia.red-bean.com> (raw)
In-Reply-To: <15927.12416.601404.240113@nick.uklinux.net>


Nick Clifton <nickc@redhat.com> writes:
> I think writing a mode for Emacs that uses MI would require quite a different
> approach to gdb-ui.el. Think of what was involved in `bringing GDB over to MI'
> (a lot of work, I would imagine).

I don't think it will be too bad.  After all, with MI GDB provides all
the same information, but in a reliably parseable form.  I would
expect a good amount of hair in gdb-ui.el to go away.

> At the time, streams didn't seem to work. I couldn't seem to generate the @
> prefix output. That's probably changed now. I can't really say much more
> until I have something concrete to experiment with.

Probably the most recent release (GDB 5.3) is a good place to start.

> I have never seen the source for GDB. Perhaps you can explain why
> annotations is difficult to maintain. In my limited experience, I
> have found that two features in a program can often be orthogonal to
> one another. That is, one feature can be developed as if the other
> feature isn't there.

Well, I talked about this a bit in my original post.  Three reasons:

- Both annotations and MI involve little changes sprinkled throughout
  GDB's code: every command that produces output has to be marked up.
  (This isn't the whole story; with MI, we often just add new commands
  that have more disciplined behavior for a program to use.)  We don't
  want to have to maintain both of those systems, when one of them is
  good enough to do the job.

- MI is more stable.  Annotation simply flags pieces of GDB's ordinary
  output to suggest where a consumer might start parsing --- but the
  data being parsed is GDB's direct output.  This means that any time
  we change the way GDB prints something --- say, to make something
  clearer, or to provide newly available information --- we may break
  clients trying to parse that output.  There's history to show that
  this is a problem.

  With MI, however, there's a much clearer segregation between the
  information intended for machine consumption, and that intended only
  for human consumption --- data that isn't yet available in a nicely
  parsed form, or presumably isn't interesting to other programs.
  They're produced using distinct calls.  So for a GDB developer, it's
  much clearer when you're changing something that another program
  might care about.

- MI can age more gracefully than annotations can.  With annotations,
  it's never clear to a GDB developer exactly which information other
  programs are consuming, and which they don't care about.  MI is
  designed so that, when you discover something a program needs, it's
  easy to rework the output code (or write some new output code) to
  produce it in MI form --- so MI's capabilities can grow in an
  evolutionary, organic kind of way, without breaking things all the
  time.

Really, once you get things going with MI, I think you'll prefer it.

> Also gdb-ui.el probably doesn't need all the annotations. If you
> lost some key ones (frames-invalid and breakpoints-invalid, for
> example) would this make it easier to maintain?

Well, but if gdb-ui takes off, people will want to add more and more
features to it.  That's what we all hope for, right?  You don't want
your success case to be the one that you've promised to avoid.

Like you, I don't have time officially allocated for this.  So we'll
both need to be patient with each other.  But Emacs is the only
environment that I can imagine using, and I use GDB in Emacs daily, so
I'm interested in doing what I can to make this work out.


  parent reply	other threads:[~2003-01-29 21:52 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
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 [this message]
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=vt2y953mxwb.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