From: Andrew Cagney <ac131313@redhat.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: Daniel Jacobowitz <drow@mvista.com>, gdb@sources.redhat.com
Subject: Re: Is stub support for the 's' packet optional or required?
Date: Tue, 18 Feb 2003 23:43:00 -0000 [thread overview]
Message-ID: <3E52C63C.6050405@redhat.com> (raw)
In-Reply-To: <1030218214337.ZM4871@localhost.localdomain>
> On Feb 18, 4:07pm, Andrew Cagney wrote:
>
>
>> # FIXME/cagney/2001-01-18: This should be split in two. A target method
>> that indicates if the target needs software single step. An ISA method
>> to implement it.
>
>
> This one puzzles me. How can gdb find out if a target (e.g. remote stub)
> can single step without first attempting the operation?
Like I said, take it with a grain of salt.
The key thing here is that it is the target, and not the architecture,
that is consulted first. It could be handled internally by target
resume, or a new method target_singlestep_p().
For remote, target_singlestep_p() might initially return false but then,
when it realises the mistake, return true. WFI would recover from this
foo-bar since the first wait would just return TARGET_WAITKIND_SPURIOUS
(or perhaphs TARGET_WAITKIND_LOOK_TRY_CONTINUE :-).
>> # FIXME/cagney/2001-01-18: This should be replaced with something that
>> inserts breakpoints using the breakpoint system instead of blatting
>> memory directly (as with rs6000).
>
>
> I agree with this and am looking into doing it.
Again it's theory.
I think it is better if WFI is directly aware of the location of the
single-step breakpoints.
Per your comments each target_resume() can also handle this directly (I
think, long ago stu grossman suggested something like that?). For
remote.c though, this may not be possible. After resuming the target it
needs to return to the event loop. Then, when a target event (eg "" or
"T...") arrives, it processes it realizing that the "s" packet was
ignored. This also means that each generic target (proc, ptrace,
remote) needs to be separatly modified.
>> # FIXME/cagney/2001-01-18: The logic is backwards. It should be asking
>> if the target can single step. If not, then implement single step using
>> breakpoints.
>
>
> It seems to me that this could be rolled into the first comment, above.
Yes.
>> (All taken with a grain of salt.)
>
>
> After (re)reading these comments, I came up with a different strategy
> (which I'm presently rethinking). Instead of asking the target if
> it can single step, it might be better to push the SOFTWARE_SINGLE_STEP
> invocation down to the bottom-most target resume() (i.e, child_resume()
> for many natives). At the moment, it's in resume() in infrun.c.
> (There is also a call which removes the breakpoints, but, presumably
> if we get things using the breakpoint system, this can be replaced
> with something better.)
Andrew
prev parent reply other threads:[~2003-02-18 23:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-17 23:50 Kevin Buettner
2003-02-18 2:39 ` Andrew Cagney
2003-02-18 16:30 ` Kevin Buettner
2003-02-18 16:51 ` Daniel Jacobowitz
2003-02-18 20:06 ` Kevin Buettner
2003-02-18 20:23 ` Daniel Jacobowitz
2003-02-18 20:42 ` Kevin Buettner
2003-02-18 21:03 ` Andrew Cagney
2003-02-18 21:43 ` Kevin Buettner
2003-02-18 23:43 ` Andrew Cagney [this message]
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=3E52C63C.6050405@redhat.com \
--to=ac131313@redhat.com \
--cc=drow@mvista.com \
--cc=gdb@sources.redhat.com \
--cc=kevinb@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