Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: [MI] Synchronous event notification
@ 2002-05-24 14:52 thomson
  2002-05-24 15:31 ` Keith Seitz
  0 siblings, 1 reply; 6+ messages in thread
From: thomson @ 2002-05-24 14:52 UTC (permalink / raw)
  To: gdb

Keith Seitz wrote:

>The example above shows that Apple has added a syntax like:
>
>  result ==>
>     stuff [ "," event-list ]
>  event-list ==>
>     "MI_HOOK_RESULT=[" event ( "," event )* "]"
>

Keith, what I see is more like

   result ==>
      stuff  ( "," event ) *
   event ==>
      "MI_HOOK_RESULT=[HOOK_TYPE=" event-name [ event-data ] "]"

which you can verify, e.g. by running a user defined command that
creates 2 breakpoints, you get two MI_HOOK_RESULTs.

In Apple's (old) code these hooks are only enabled for the duration of an
-interpreter-exec console command.  That means there are several
ways a UI is notified of breakpoint creation

after -break-insert, you get
     ^done,bkpt=[number="1",type="breakpoint", ...]

after -interpreter-exec console "break ...", or
using -interpreter-exec to run a user defined command
or script that creates breakpoints, you are proposing
     ^done,event=[name="breakpoint_create", ...]

from a breakpoint command list (e.g. enable bkpt 2
after bkpt 1 is hit 100 times) ...
hmm, when MI is enabled these commands don't run
unless you also use --noasync, maybe bpstat_do_actions()
is not called from the event loop?
Anyway, when I do get them to run, there is no notification
at all.

As consumers, we would prefer to have one notification
that is reliable and consistent.


Are you also looking at the other, non-event hooks
Apple introduced?

query hook - always answers "y" to a "y or n" query
(seems a little scary)

read one line hook - If a console
command needs multiline input (e.g."define", "document",
"if", or "while), prompt with
     =read-one-line,prompt="prompt"
so the UI can know not to prepend "-interpreter-exec console"
to the next input line.

resume hook - if a console command attempts to run the target,
don't do it, instead send the notification
      =rerun
back to the UI, I guess so it can get out of "CLI mode" first.


Brian Thomson
IBM


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [MI] Synchronous event notification
@ 2002-05-15 11:23 Keith Seitz
  2002-05-24 13:41 ` Andrew Cagney
  0 siblings, 1 reply; 6+ messages in thread
From: Keith Seitz @ 2002-05-15 11:23 UTC (permalink / raw)
  To: gdb

Hi,

I've been working on integrating Apple's "-interpreter-exec" changes, and
I wanted to see if I could get some sort of consensus on how event
notifications should be defined.

In the trunk right now, MI ignores event notifications. Adding a mechanism
is vital to the success of MI.

Apple has added this, and all event notifications are tacked onto the
mi-command result:

  (gdb)
  -interpreter-exec console "break main"
  Breakpoint 1 at ...
  ^done,MI_HOOK_RESULT=[HOOK_TYPE="breakpoint_create",bkpt={number="1",...}]

Right now, this is done by defining a bunch of (existing) hooks when mi
runs. I presume that we want to switch over to using gdb-events, hoping
one day to deprecate the hooks, but that's not really the issue (since
they behave essentially the same in non-asynch). The real question is, how
do maintainers want this information communicated to mi clients?

The example above shows that Apple has added a syntax like:

  result ==>
     stuff [ "," event-list ]
  event-list ==>
     "MI_HOOK_RESULT=[" event ( "," event )* "]"
  event ==>
     "HOOK_TYPE=" event-name [ event-data ]
  event-name ==>
     "breakpoint_create" | "breakpoint_delete" | ...

and such.

Since hooks are really just event notifications, I would like to propose
that we use a definition like the above, but changing the string literals
a litte:

  event-list ==>
    "events=[" event ( "," event )* "]"
  event ==>
    "name=" event-name [ event-data ]
  event-name ==>
    "breakpoint_create" | "breakpoint_delete" | ...

Please discuss.
Keith



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

end of thread, other threads:[~2002-06-01 22:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-24 14:52 [MI] Synchronous event notification thomson
2002-05-24 15:31 ` Keith Seitz
  -- strict thread matches above, loose matches on Subject: below --
2002-05-15 11:23 Keith Seitz
2002-05-24 13:41 ` Andrew Cagney
2002-05-24 15:26   ` Keith Seitz
2002-06-01 15:25     ` Andrew Cagney

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