Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Joel Brobecker <brobecker@gnat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Re-initializing a list after the control returns to gdb...
Date: Wed, 26 Feb 2003 15:57:00 -0000	[thread overview]
Message-ID: <3E5C5CBD.2030201@redhat.com> (raw)
In-Reply-To: <20030225013722.GM910@gnat.com>

> [Sorry for answering late, got preempted...]
> 
> 
>> In hindsite, it needs to be converted to an observer model (or a new 
>> observer model introduced and the current gdb-hooks changed to one of 
>> the many observers).
> 
> 
> One model that works extremely well is the signals system implemented in
> glib. I find it very nicely done. It would be nice if we could reuse
> this, but this is a very very complex machinery doing probably way too
> much for what we need in GDB.

Yes.  GDB just needs a single consistent event mechanism.

> I would instead suggest something much more simple, like this:
> 
>    enum notice_kinds
>    {
>      breakpoint_created_notice,
>      breakpoint_deleted_notice,
>      ...
>      invalid_last_notice,   /* Should always be last.  */
>    };

gdb-events.sh used individual wrapper functions rather than trusting an 
enum, a void *, and dodgy casts.  This was to ensure that the external 
iterfaces were all strongly typed (calls checked with -Werror) and all 
nasty casts were burried in the .c file.

It did that right.

It, however, made several mistakes:

- it tried to group all the events together (you've proposed individual 
registration which is much more incremental)

- it didn't implement broadcast (as proposed here)

- `event' in GDB has multiple meanings so the name is confusing.

So, can you get a prototype observer working for just your ada event 
(but keep in mind that other events will be boiler-plated)?

As for the names, just use the terminology found in the patterns book - 
observer.[hc].  observer_update_xxx (or notify_xxx), 
observer_attach_xxx, observer_detach_xxx I think.  If GDB needs more 
than one observer, there's a problem.

(oh, unless you've an immediate need for that data/context parameter, 
i'd leave it out - such a mechanis can be left to the person that 
actually needs)

(shh, doco - but I have a cunning plan - see my recent post about 
revamping gdbarch.sh into doc/gdbarch.texi).

Andrew



  reply	other threads:[~2003-02-26 15:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-19  2:01 Joel Brobecker
2003-02-19 12:47 ` Andrew Cagney
2003-02-19 16:05   ` Joel Brobecker
2003-02-19 16:49     ` Andrew Cagney
2003-02-19 17:46       ` Joel Brobecker
2003-02-19 17:01 ` Andrew Cagney
2003-02-19 17:50   ` Joel Brobecker
2003-02-19 18:05     ` Andrew Cagney
2003-02-19 19:24       ` Joel Brobecker
2003-02-19 20:30         ` Andrew Cagney
2003-02-25  1:37           ` Joel Brobecker
2003-02-26 15:57             ` Andrew Cagney [this message]
2003-02-27  7:13               ` Joel Brobecker
2003-02-27 18:44                 ` Andrew Cagney
2003-02-28  7:42                   ` Joel Brobecker

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=3E5C5CBD.2030201@redhat.com \
    --to=ac131313@redhat.com \
    --cc=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.com \
    /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