Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* obsoleting the annotate level 2 interface
@ 2003-01-21  7:38 Jim Blandy
  2003-01-21 16:15 ` Andrew Cagney
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Jim Blandy @ 2003-01-21  7:38 UTC (permalink / raw)
  To: gdb


GDB seems to support two different ways of doing detailed annotations
of its output for consumption by other programs: MI and 'set annotate
2'.  I don't think annotation level 2 has many active users, if any at
all.  It pervades GDB's code.  Would it make sense to put 'set
annotate 2' on the path to obsolescence?

Some background: the 'set annotate' command sets the
'annotation_level' variable.  There are only three distinguished
values for this variable:

0: nothing special, GDB behaves normally.
1: in source.c:line_info and stack.c:print_frame_info, when we print
   the source line, we print out something extra that helps Emacs pop
   up the source code in a window.
2 or greater: we enable around 250 calls to a variety of functions in
   annotate.c to mark and identify lots of things GDB prints.

I think we should keep level 1, since the standard Emacs GDB interface
uses it, and it's not very much code.

I'd like to see GDB dump level 2, since it duplicates MI, badly.  MI's
design ensures that whoever's trying to parse GDB's output gets
something that's well-formed, whereas annotate just sticks escape
codes into the outgoing stream of text.  This means that, if you
change the way anything prints, you may break an annotate level 2
client.  But to break an MI client, you actually have to change a
ui_out call, whose sole purpose is to produce output for clients to
read.  So MI is a much more maintainable approach, because it's easier
for people to see what they're doing.

If folks agree that annotate level 2 should go, we could:
- announce that annotate level 2 will be disabled in the release after
  next;
- in that release, disable the code, but leave it there, to see if
  anyone complains, and whether they can be persuaded to switch to MI;
  and
- in the release after that, if all goes well, remove the code to
  support annotation level 2.

Personally, I'd like to see Emacs switch from annotation level 1 to
MI, too; then we could get rid of annotation altogether.  But I think
it makes sense to tackle level 2 first, since I don't think it has
many users (if any).


^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: obsoleting the annotate level 2 interface
@ 2003-01-21 17:41 Michael Elizabeth Chastain
  2003-01-21 20:25 ` David Carlton
  2003-01-22 16:45 ` Andrew Cagney
  0 siblings, 2 replies; 23+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-21 17:41 UTC (permalink / raw)
  To: gdb, jimb

Jim Blandy writes:
> If folks agree that annotate level 2 should go, we could:
> - announce that annotate level 2 will be disabled in the release after
>   next;
> - in that release, disable the code, but leave it there, to see if
>   anyone complains, and whether they can be persuaded to switch to MI;
>   and
> - in the release after that, if all goes well, remove the code to
>   support annotation level 2.

According to the NEWS file in gdb 5.1, the annotation interface
is deprecated.  So I say, go for it!

There is one PR open against annotation level 2: pr gdb/785.  I think we
can quash it if we remove annotation level 2.  I sent mail to the
submitter, rros7605@postoffice.uri.edu, about other matter (pr gdb/786)
on 2003-01-01 and haven't heard back from them, so they probably don't
care.  And if we remove annotation level 2, then we don't care.

gdb.c++/annota2.exp reports two KFAIL's which are unrelated to
annotation.  One KFAIL is about a hardware watchpoint that triggers on
the first instruction after resuming a breakpoint.  The other is about
sending a ^C and then immediately reading from gdb (I suspect there is a
race condition here but I'm not sure).  Actually it would be good to
move those tests to a different test script right now, because it's such
a pain to work with an annotation-enabled test script.

I've made a note in my TODO list to do that.

> Personally, I'd like to see Emacs switch from annotation level 1 to
> MI, too; then we could get rid of annotation altogether.  But I think
> it makes sense to tackle level 2 first, since I don't think it has
> many users (if any).

emacs invokes gdb with "gdb -fullname" so it's just our gdb code which
maps that to "annotate level 1".  We can continue to do the same
behavior and just call it the "fullname" flag instead of the
"annotation" flag.

It looks a bit hard to remove the behavior, because lisp/gud.el
interacts with many different debuggers.  I suppose it would be nice to
have a new emacs gdb interface which takes full advantage of MI, but
that would not make lisp/gud.el obsolete, so the "-fullname" behavior
would not be obsolete.

Michael C


^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: obsoleting the annotate level 2 interface
@ 2003-01-21 18:09 Michael Elizabeth Chastain
  2003-01-22  7:56 ` Arnaud Charlet
  0 siblings, 1 reply; 23+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-21 18:09 UTC (permalink / raw)
  To: ac131313, jimb; +Cc: gdb

Andrew C asks:
> What of the other potential clients (DDD, ...)?

I glanced at DDD.  The most recent DDD is DDD 3.3.1, released 2001-05-02.
It has a "-fullname" option which it passes down to gdb.  ddd/GDBAgent.c
has code to discard any annotation-2 output coming from gdb:

  # ddd/GDBAgent.c
  case '\032':
      // In annotation level 2, GDB sends out `annotation'
      // sequences like `\n\032\032prompt\n'.  Future DDD
      // versions might want to look at these annotations; right
      // now, we simply weed them out.

There's similar code for the annotation-2 prompt.  I didn't see any code
in DDD 3.3.1 to turn on annotation, it just wants to ignore any
annotation-2 that the user turns on.

The CVS version of ddd/GDBAgent.c (from sourceforge) still has this code.

http://www.gnu.org/software/ddd has links to several other front ends,
including: gvd, insight, kdbg, xxgdb, tgdb, xwpe.

Let me know if it would be useful to chase all these projects down and
report on them.

Michael C


^ permalink raw reply	[flat|nested] 23+ messages in thread
[parent not found: <1043140716.4941.ezmlm@sources.redhat.com>]
* Re: obsoleting the annotate level 2 interface
@ 2003-01-21 20:40 Michael Elizabeth Chastain
  0 siblings, 0 replies; 23+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-21 20:40 UTC (permalink / raw)
  To: carlton; +Cc: gdb, jimb

David C writes:
> (I don't want to delete them from that file until the whole file is gone,
> but I do want to reproduce the bugs in other files.)

That's my preference too.  Some day I'll be comparing gdb-5.3 to
the gdb 5.4/6.0 release candidate, and this way makes the comparison
either.

> I think I have a patch around to reproduce the watchpoint bug in
> gdb.base/watchpoint.exp; I'll polish that off and submit it.

Sounds good, I'll have my test bed ready for it.

I'll work on the infamous "annotate-quit" test.  I suppose that belongs
in gdb.base/interrupt.exp.

Michael C


^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: obsoleting the annotate level 2 interface
@ 2003-02-04  1:45 Mike Mueller
  2003-02-04  6:58 ` Andrew Cagney
  0 siblings, 1 reply; 23+ messages in thread
From: Mike Mueller @ 2003-02-04  1:45 UTC (permalink / raw)
  To: gdb

Andrew Cagney wrote:

> I don't think that is sufficient - making something deprecated 
> only tells the user that they should not use it in new 
> development.  Not that they must rewrite existing code to not 
> use it.  To do that we'd have to  obsolete it.  (Asside, this is 
> the same as for code - deprecating a  function only stops it 
> being used in new code.)
 
> I think something needs to be done to the next release that `rubs 
> the  users nose in it'.

> Andrew

I would like to reiterate the points that many have made thus far.

Existing applications depend on annotate level 1 (ddd, gvd, ...) and 
level 2 (emacs, cgdb).  Until the MI interface is complete (supports 
CLI and GDB user output) and all existing applications have made 
the switch to using the MI, the annotations cannot be removed.  
My current understanding is that GDB/MI is not a completely viable 
alternative for these GDB interfaces to use to replace annotate 1 or 
2.  Therefore, the annotations -- while being deprecated -- must be 
retained in future releases until the GDB/MI is capable of 
supporting these applications.

Mike

(CGDB developer -- http://cgdb.sourceforge.net)


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

end of thread, other threads:[~2003-02-04  6:58 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-21  7:38 obsoleting the annotate level 2 interface 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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox