Re: [PATCH] Hooks still needed for annotations

Bob Rossi
2005-06-15T15:24:44Z

On Fri, Jun 10, 2005 at 03:26:34PM +1200, Nick Roberts wrote:
> Bob Rossi writes:
> > On Tue, Jun 07, 2005 at 09:57:48AM +1200, Nick Roberts wrote:
> > >
> > > > They are deprecated. I believe there's a clear consensus that the
> > > > entire annotation system is going to go, and in the near future. Just
> > > > not yet.
> > >
> > > Then lets try to remove the ones that can go. In 2003 Andrew introduced
> > > level 3 annotations as a subset of level 2 (with the markup annotations
> > > left out). Since then I have been using those quite happily with Emacs.
> > >
> > > So, as far as Emacs is concerned, the annotations that are restricted to
> > > level 2 in annotate.c, and this must be over half of them, can go.
> > >
> > > Bob is this also the case for CGDB?
> >
> > I could look and see what annotations CGDB uses. Would this be helpful?
> > I think it's only a handful.
>
> Well there hasn't been any interest shown from the global maintainers, but I
> think it would be helpful. Do you need any of the annotations that are
> not generated by level 3 annotations? (Specified by
> if (annotation_level == 2)... in annotate.c)

Sorry about the delay, here is the list of annotations I use/don't use.

"source", handle_source

"pre-commands", handle_misc_pre_prompt
"commands", handle_misc_prompt
"post-commands", handle_misc_post_prompt

"pre-overload-choice", handle_misc_pre_prompt
"overload-choice", handle_misc_prompt
"post-overload-choice", handle_misc_post_prompt

"pre-query", handle_misc_pre_prompt
"query", handle_misc_prompt
"post-query", handle_misc_post_prompt

"pre-prompt-for-continue", handle_misc_pre_prompt
"prompt-for-continue", handle_misc_prompt
"post-prompt-for-continue", handle_misc_post_prompt

"pre-prompt", handle_pre_prompt
"prompt", handle_prompt
"post-prompt", handle_post_prompt

"breakpoints-headers", handle_breakpoints_headers
"breakpoints-table-end", handle_breakpoints_table_end
"breakpoints-table", handle_breakpoints_table

"breakpoints-invalid", NOT_SUPPORTED
"value-history-begin", NOT_SUPPORTED
"value-history-value", NOT_SUPPORTED
"value-history-end", NOT_SUPPORTED
"value-begin", NOT_SUPPORTED
"value-end", NOT_SUPPORTED
"arg-begin", NOT_SUPPORTED
"arg-name-end", NOT_SUPPORTED
"arg-value", NOT_SUPPORTED
"arg-end", NOT_SUPPORTED
"field-begin", NOT_SUPPORTED
"field-name-end", NOT_SUPPORTED
"field-value", NOT_SUPPORTED
"field-end", NOT_SUPPORTED

"field", handle_field
"record", handle_record
"error-begin", handle_error_begin
"error", handle_error
"exited", handle_exited
"quit", handle_quit

"display-begin", NOT_SUPPORTED
"display-number-end", NOT_SUPPORTED
"display-format", NOT_SUPPORTED
"display-expression", NOT_SUPPORTED
"display-expression-end", NOT_SUPPORTED
"display-value", NOT_SUPPORTED

If it says, NOT_SUPPORTED then I don't use them. Otherwise I do. I
showed you the semantics behind the annotation also. For instance, all
of the pre,*,post commands could be changed to pre-query,
query, post-query and CGDB would continue to work just fine.

Of course, any that I haven't listed, CGDB doesn't use either.

> > > Emacs doesn't use breakpoints-invalid or frames-invalid either and they
> > > spew out so often that it makes it hard to interrupt the inferior. However
> > > I would like to keep them for the moment, as they provide clues as to where
> > > to put code for event nortification in MI. Perhaps these could be restricted
> > > to level 2.
> >
> > I still use level 2, and personally thought introducing level 3 was a
> > really bad idea.
>
> Why is it a bad idea?

Well, it goes back to making CGDB more complicated. For example, CGDB
works with just about any version of GDB. (even 5-7 years old).

However, once you go to annotate level 3, now CGDB will have to detect
the version of annotations that GDB supports. This makes things
unnecessarily more complicated. Why not just get rid of annotate 3, and
slowly remove features from annotate 2?

> > Do you already use level 3, or could we simply just start stripping down
> > level 2?
>
> Keeping level 3 allows a transition stage, I would now like to use it for
> breakpoints-invalid and frames-invalid as stated above, in case I suddenly
> find that Emacs does need them.

Well breakpoints-invalid and frames-invalid already work (kind of) in
a2. There is no reason to deprecate a2 and then get the same
functionality in a3. (Although I might be missing something?). I really
think that adding an a3 interface is a real bad idea.

Thanks,
Bob Rossi