From: Jim Ingham <jingham@apple.com>
To: Bob Rossi <bob@brasko.net>
Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sources.redhat.com
Subject: Re: RFC: MI output during program execution
Date: Wed, 10 Aug 2005 02:37:00 -0000 [thread overview]
Message-ID: <2040BEEA-4200-4118-91EB-D093ED4D37A1@apple.com> (raw)
In-Reply-To: <20050810004826.GD3557@white>
On Aug 9, 2005, at 5:48 PM, Bob Rossi wrote:
> On Tue, Aug 09, 2005 at 08:41:28PM -0400, Daniel Jacobowitz wrote:
>
>> On Tue, Aug 09, 2005 at 06:34:21PM -0400, Bob Rossi wrote:
>>
>>> However, in the meantime, I think it's possible to query the
>>> state of
>>> GDB at any moment. So, if you allow the user to enter a command via
>>> -interpreter-exec console, you could then follow that command up
>>> with
>>> other MI commands to sync the state of GDB with the state of the FE.
>>>
>>
>> But we haven't got all the relevant query commands, I think. And I
>> haven't a clue what the full set would be. Rather than adding them,
>> investing effort in getting the async approach going makes more sense
>> to me.
>>
>
> I agree. However, getting the observer approach up and running,
> will in
> a way, define the full set.
>
>
>> As Jim's pointed out, you can need this any time you hit a
>> breakpoint,
>> if the user has set commands on it. Keeping track of this in the
>> FE is
>> going to be tricky. Also, if you're presenting a real console window
>> and you have to do a half-dozen queries after every command to
>> keep the
>> UI up to date, that's probably going to be visibly slow.
>>
>
> Here is another odd scenario, Jim, please give some info if you have
> experience in this area.
>
> If you hit a breakpoint, and the observer starts to send you data,
> does
> it
> - send all the state data in one async response, in the same
> response as
> the async MI command that says *stopped?
> - send all the state data in one async response, in a different
> response
> as the async MI command that says *stopped?
> - send all the state data, each in different async response's, in a
> different response as the async MI command that says *stopped?
>
> This may seem unimportant, however I believe it could be marginally
> important. For instance, does the front end have to wait for the async
> observer response before it can do anything else?
Remember I haven't done this with observers or events yet. The way I
did it with hooks, the result of the hooks is gathered into the
"^done" or the other termination states for the command. So for
instance, if you run gdb on itself, and do:
(top-gdb) commands 3
Type commands for when breakpoint 3 is hit, one per line.
End with a line saying just "end".
>print argc
>up
>break decode_line_1
>continue
>end
(top-gdb) set interpreter mi
-exec-run
*stopped,reason="breakpoint-hit",commands="yes",bkptno="3",thread-id="1"
~"$1 = 15"
~"\n"
~"#1 0x0003c4d0 in do_catch_errors (uiout=0x337618, data=0xbffff0f0)
at ../../gdb/src/gdb/top.c:577\n"
~"577\t return args->func (args->func_args);\n"
~"Breakpoint 4 at 0x8237c: file ../../gdb/src/gdb/linespec.c, line
735.\n"
~"Continuing.\n"
^continuing
*started,MI_HOOK_RESULT=
{HOOK_TYPE="frame_changed",frame="1"},MI_HOOK_RESULT=
{HOOK_TYPE="breakpoint_create",bkpt=
{number="4",type="breakpoint",disp="keep",enabled="y",addr="0x0008237c",
func="decode_line_1",file="../../gdb/src/gdb/
linespec.c",line="735",shlib="/Volumes/ThePlayground/Users/jingham/
Work/gdb-sources/tot-shlib-experiment/build/gdb/
gdb",times="0"}},reason="breakpoint-command"
GNU gdb 2004-03-03-cvs (Thu Jul 28 18:14:44 GMT 2005)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "powerpc-apple-darwin8.1.0".
Setting up the environment for debugging gdb.
*stopped,reason="breakpoint-hit",commands="no",bkptno="4",thread-id="1"
So it's sort of like your third option, except it sends it as part of
the message that tells you the breakpoint command handling is done.
If the breakpoint had not done a continue, you would see:
=breakpoint-command-completed,MI_HOOK_RESULT=
{HOOK_TYPE="frame_changed",frame="1"},MI_HOOK_RESULT=
{HOOK_TYPE="breakpoint_create",bkpt=
{number="4",type="breakpoint",disp="keep",enabled="y",addr="0x0008237c",
func="decode_line_1",file="../../gdb/src/gdb/
linespec.c",line="735",shlib="/Volumes/ThePlayground/Users/jingham/
Work/gdb-sources/tot-shlib-experiment/build/gdb/gdb",times="0"}}
It might make more sense to have the "*started" be an "=started"
message, I'm not sure why I made it a "*", I guess by analogy with
the "*stopped"...
Jim
>
> Thanks,
> Bob Rossi
>
next prev parent reply other threads:[~2005-08-10 1:07 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1123605445.30442.ezmlm@sources.redhat.com>
2005-08-09 17:24 ` Jim Ingham
2005-08-09 17:59 ` Bob Rossi
2005-08-09 18:09 ` Jim Ingham
2005-08-09 18:23 ` Bob Rossi
2005-08-09 18:40 ` Jim Ingham
2005-08-10 0:48 ` Daniel Jacobowitz
2005-08-10 0:48 ` Jim Ingham
2005-08-10 2:37 ` Daniel Jacobowitz
2005-08-09 18:13 ` Eli Zaretskii
2005-08-09 18:23 ` Bob Rossi
2005-08-09 19:39 ` Eli Zaretskii
2005-08-10 0:41 ` Bob Rossi
2005-08-10 0:42 ` Daniel Jacobowitz
2005-08-10 1:07 ` Bob Rossi
2005-08-10 2:37 ` Jim Ingham [this message]
2005-08-12 8:06 ` Bob Rossi
2005-08-12 10:36 ` Eli Zaretskii
2005-08-12 12:05 ` Bob Rossi
2005-08-12 17:25 ` Eli Zaretskii
2005-08-12 20:45 ` Bob Rossi
2005-08-12 20:49 ` Daniel Jacobowitz
2005-08-13 1:11 ` Bob Rossi
2005-08-13 1:15 ` Daniel Jacobowitz
2005-08-13 11:07 ` Eli Zaretskii
2005-08-12 20:54 ` Mark Kettenis
2005-08-13 15:05 ` Bob Rossi
2005-08-12 21:01 ` Daniel Jacobowitz
2005-08-13 11:13 ` Eli Zaretskii
2005-08-12 17:03 ` Jim Ingham
2005-08-13 0:33 ` Bob Rossi
2005-08-13 0:44 ` Jim Ingham
2005-08-13 5:04 ` Bob Rossi
2005-08-13 6:47 ` Daniel Jacobowitz
2005-08-13 11:06 ` Jim Ingham
2005-08-13 14:51 ` Bob Rossi
2005-08-13 16:55 ` Daniel Jacobowitz
2005-08-13 12:53 ` Eli Zaretskii
2005-08-13 21:52 ` Mark Kettenis
2005-08-13 0:22 ` Daniel Jacobowitz
2005-08-11 10:10 ` Daniel Jacobowitz
2005-08-18 13:28 Nick Roberts
2005-08-19 0:52 ` Mark Kettenis
-- strict thread matches above, loose matches on Subject: below --
2005-08-17 3:18 Nick Roberts
[not found] <1124238360.5670.ezmlm@sources.redhat.com>
2005-08-17 1:10 ` Jim Ingham
2005-08-15 2:15 Nick Roberts
2005-08-15 2:13 Nick Roberts
2005-08-15 4:26 ` Daniel Jacobowitz
2005-08-15 10:03 ` Nick Roberts
2005-08-16 0:04 ` Bob Rossi
2005-08-16 0:33 ` Nick Roberts
2005-08-16 0:43 ` Daniel Jacobowitz
2005-08-16 3:54 ` Bob Rossi
2005-08-08 5:20 Nick Roberts
2005-08-08 13:05 ` Daniel Jacobowitz
2005-08-08 18:23 ` Jim Ingham
2005-08-09 17:32 ` Nick Roberts
2005-08-21 22:09 ` Nick Roberts
2005-08-24 2:20 ` Stan Shebs
2005-08-24 16:59 ` Nick Roberts
2005-08-24 20:15 ` Jim Ingham
2005-08-24 20:48 ` Nick Roberts
2005-08-27 12:09 ` Stan Shebs
2005-09-12 3:20 ` Nick Roberts
2005-09-12 3:40 ` Daniel Jacobowitz
2005-09-19 10:30 ` Nick Roberts
2005-09-19 13:17 ` Daniel Jacobowitz
2005-09-19 22:12 ` Nick Roberts
2005-09-19 22:17 ` Nick Roberts
2005-09-19 22:32 ` Daniel Jacobowitz
2005-10-03 3:20 ` Nick Roberts
2005-10-03 13:18 ` Daniel Jacobowitz
2005-10-03 20:28 ` Nick Roberts
2005-10-03 20:31 ` Daniel Jacobowitz
2005-10-03 21:39 ` Stan Shebs
2005-10-03 21:50 ` Jim Ingham
2005-10-03 21:59 ` Daniel Jacobowitz
2005-10-03 22:01 ` Daniel Jacobowitz
2006-03-28 0:40 ` Nick Roberts
2006-03-28 22:12 ` Daniel Jacobowitz
2006-03-28 22:36 ` Nick Roberts
2006-03-28 23:13 ` Daniel Jacobowitz
2005-08-08 21:00 ` Eli Zaretskii
2005-08-09 17:52 ` Nick Roberts
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=2040BEEA-4200-4118-91EB-D093ED4D37A1@apple.com \
--to=jingham@apple.com \
--cc=bob@brasko.net \
--cc=eliz@gnu.org \
--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