From: "Marc Khouzam" <marc.khouzam@ericsson.com>
To: "Vladimir Prus" <vladimir@codesourcery.com>, <gdb@sources.redhat.com>
Subject: RE: Re: MI *stopped event with CLI commands
Date: Thu, 18 Dec 2008 03:30:00 -0000 [thread overview]
Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA04E1BED4@ecamlmw720.eamcs.ericsson.se> (raw)
In-Reply-To: <gi4udm$jpr$1@ger.gmane.org>
Nick Roberts wrote:
>
> set target-async on
>
> first, you do get the full information. Perhaps this should be the default
> for targets which can run asynchronously.
Vladimir Prus wrote:
>
> Probably. Though it does not change the fact that *stopped without details sounds
> like a bug. I'll take a look, though it might take a few days.
I looked into the fact that *stopped worked properly with async on but not with
async off (thanks Nick.) My understanding of GDB internals is quite limited, but
I believe what is happening is the following:
When issuing a command that resumes the inferior, say -exec-continue or continue,
we eventually end up in method proceed(...) of infrun.c
On the call chain to that method, if the
command that resumed the inferior was a CLI command (e.g. continue)
the uiout structure has been forced to be the CLI uiout; this makes sense to me
since we want any output of the CLI command to be formatted as CLI output.
However, once the inferior stops, the output that follows should no longer be in
CLI format, I believe. So, after the inferior is resumed, we should probably go back
to the MI uiout.
In async mode, this does happens because proceed(...) returns immediately and everything
gets undone nicely. But when async is off proceed(...) blocks with the code:
if (!target_can_async_p ())
{
wait_for_inferior (0);
normal_stop ();
}
Since normal_stop() is called directly from proceed(...) the uiout is still set to CLI
in this case, and the information of the *stopped event is created in a CLI format, which
explains why *stopped has no information.
So, if I understood all this right, I think the uiout should be reset before calling
normal_stop(). I'm sure this is an over-simplification, but I hope it can point
in the right direction for this bug.
Thanks
Marc
next prev parent reply other threads:[~2008-12-18 3:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-15 4:20 Marc Khouzam
2008-12-15 6:17 ` Nick Roberts
2008-12-15 6:46 ` Vladimir Prus
2008-12-18 3:30 ` Marc Khouzam [this message]
2008-12-18 6:17 ` Nick Roberts
2009-01-12 3:11 ` Marc Khouzam
2009-01-12 11:36 ` 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=6D19CA8D71C89C43A057926FE0D4ADAA04E1BED4@ecamlmw720.eamcs.ericsson.se \
--to=marc.khouzam@ericsson.com \
--cc=gdb@sources.redhat.com \
--cc=vladimir@codesourcery.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