From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6977 invoked by alias); 13 Aug 2005 12:53:40 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6956 invoked by uid 22791); 13 Aug 2005 12:53:35 -0000 Received: from centrmmtao05vip.cox.net (HELO centrmmtao05.cox.net) (68.1.16.143) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 13 Aug 2005 12:53:35 +0000 Received: from white ([68.9.64.121]) by centrmmtao05.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050813125333.ITO22572.centrmmtao05.cox.net@white>; Sat, 13 Aug 2005 08:53:33 -0400 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1E3vW1-0004Rq-00; Sat, 13 Aug 2005 08:53:33 -0400 Date: Sat, 13 Aug 2005 14:51:00 -0000 From: Bob Rossi To: Jim Ingham Cc: Daniel Jacobowitz , gdb-patches@sources.redhat.com, Eli Zaretskii Subject: Re: RFC: MI output during program execution Message-ID: <20050813125333.GA13851@white> Mail-Followup-To: Jim Ingham , Daniel Jacobowitz , gdb-patches@sources.redhat.com, Eli Zaretskii References: <20050810004128.GA4264@nevyn.them.org> <20050810004826.GD3557@white> <2040BEEA-4200-4118-91EB-D093ED4D37A1@apple.com> <20050812012810.GA10011@white> <29EA180F-E3C7-4D04-B500-655391EDA2D9@apple.com> <20050813002230.GA11892@white> <20050813011542.GC11892@white> <20050813050414.GA7717@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-SW-Source: 2005-08/txt/msg00157.txt.bz2 On Fri, Aug 12, 2005 at 11:47:24PM -0700, Jim Ingham wrote: > > On Aug 12, 2005, at 10:04 PM, Daniel Jacobowitz wrote: > > >On Fri, Aug 12, 2005 at 09:15:42PM -0400, Bob Rossi wrote: > > > >>On Fri, Aug 12, 2005 at 05:33:25PM -0700, Jim Ingham wrote: > >> > >>>>OK, unfortunatly, I'm still trying to catch up here. I think I > >>>>understand the observer approach, however, what is the event > >>>>approach? > >>>>Is that different than the "hooks" you have? > >>>> > >>> > >>>So it LOOKS like the "events" are supposed to be the replacements > >>>for > >>>the hooks... > >>> > >>>But then there's the whole observer thing, which from what I read of > >>>the gdb-patches traffic at the time was supposed to be a more > >>>general > >>>solution for watching interesting events. But it doesn't seem to be > >>>used all that much. > >>> > >>>So I am not really sure what's supposed to be happening here. > >>> > >>>Moving from hooks to events seems a trivial formal exercise. I > >>>don't > >>>know if they will get deprecated soon or what, however... > >>> > >> > >>Jim thanks for all the help! Really. > >> > >>Can anyone reliable answer if hooks or events are supposed to be > >>used in > >>the future for GDB? if neither of these, is there another approach? > >> > >>If there is no approach that the core GDB developers prefer, or know > >>that are already in place, we are free to choose from any approach. > >> > > > >Or do as I described earlier today, and add a new mechanism > >specifically designed to notify interpreters of events that could be > >interesting (which might meet Eli's concerns about misusing observers, > >but we'd have to ask him!), or else call into the MI interpreter > >directly from the code without messing with any kind of mechanism. > > The hooks worked just fine for this purpose. Dunno why they were > deprecated. The events which are in all the same places, and work > pretty much the same way, also should be just fine... We should pick > one of these, I think, rather than invent yet another. Agreed, and if I understand them, both Daniel and Eli OK this idea. The strange this is, it doesn't look like the "event" approach was a replacement for the "hook" approach, unless it was a long time coming. For instance, in breakpoint.c, 1.167 (cagney 21-Apr-04): if (deprecated_create_breakpoint_hook) 1.167 (cagney 21-Apr-04): deprecated_create_breakpoint_hook (b); 1.2 (cagney 23-Feb-00): breakpoint_create_event (b->number); The event's seem to have been there forever. Apparently, I have no idea to figure out why someone Deprecated a piece of software in GDB because the ChangeLog just says, 2004-04-21 Andrew Cagney * annotate.h (deprecated_annotate_starting_hook) (deprecated_annotate_stopped_hook) (deprecated_annotate_exited_hook) (deprecated_annotate_signal_hook) (deprecated_annotate_signalled_hook): Deprecate. ... Anyways, it looks like all of the "hooks" have been removed and the replacement is events, like you have noticed Jim. The problem I see is that gdb-events.[hc] is supposed to be the interface. However, I notice 2 problems. The first is that the events layer looks like it is unable to provide events to more than one listener. There is a single static event variable in the body of gdb-events.c. I would think more than one subsystem would want to know about the events that have been gathered so far. Maybe that variable should be a list? Second, the function that installs the event hooks is deprecated! So, it appears that both the hooks and the custom events have been deprecated. This is odd. How would the event interface be usable if the custom event hooks (very bad name, since this is for events, not hooks) function was deprecated? 1.15 (cagney 26-Jun-04): extern struct gdb_events *deprecated_set_gdb_event_hooks (struct gd b_events *vector); This change is *not* in the ChangeLog, so I have no idea why it was changed. Anyways, the events look just fine to me, as long as the above questions can be satisfied. Thanks, Bob Rossi