From: Pedro Alves <palves@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/5] range stepping: gdb
Date: Wed, 15 May 2013 12:39:00 -0000 [thread overview]
Message-ID: <519381E9.3020007@redhat.com> (raw)
In-Reply-To: <83ppws5w00.fsf@gnu.org>
On 05/15/2013 12:21 PM, Eli Zaretskii wrote:
>> Date: Wed, 15 May 2013 11:23:24 +0100
>> From: Pedro Alves <palves@redhat.com>
>> CC: gdb-patches@sourceware.org
>>
>>>> +@var{end} is the address of the first instruction beyond the step
>>>> +range, and @strong{not} the address of the last instruction within it.
>>>> +(This has the property that @var{start} == @var{end} single-steps
>>>> +once, and only once, even if the instruction at @var{start} jumps to
>>>> +@var{end}.)
>>>
>>> This sentence in parentheses got me completely confused. Before
>>> reading it, I thought I understood what is this about; now I don't.
>>> In particular, if START is equal to END, then how in the world could
>>> the instruction at START jump to END?
>>
>> Sorry, I had that typo in the gdbserver code as well, fixed it
>> there, but missed this one.
>>
>> It should read, even if the instruction at @var{start} jumps to @var{start}.
>>
>> vCont;r first steps, then checks. IOW:
>>
>> vCont ;r ADDR1,ADDR1
>>
>> is equivalent to (and could be thought to supersede):
>>
>> vCont ;s
>>
>>> And if END is excluded from the
>>> range, then why when START equals END do we step at all? Please
>>> explain.
>>
>> It's just a design decision. I recall at least one target I saw I worked
>> with that supported range stepping, and it didn't even a distinction
>> between range vs no-range step commands. The way to do a single step
>> was to pass both addresses the same. I find it a better design than
>> requiring the target do one current-address check _before_ stepping,
>> and another _after_ single-stepping.
>
> Doesn't this mean that these two use cases are explicit exceptions
> from the rule that END is excluded?
Nope. There's no exception.
With:
vCont ;r START,END
#1 - The stub single-steps the thread.
#2 - Once the thread stops, the stub checks whether the thread
stopped in the [START,END) range. If so, goto #1.
It not, goto #3.
#3 - The stub reports to gdb that the thread stopped stepping.
If it happens that START and END are the same, then #2 always
goes to #3.
When I said:
"(This has the property that @var{start} == @var{end} single-steps
once, and only once, even if the instruction at @var{start} jumps to
@var{start}.)"
I was trying to clarify the case of the instruction at START being:
jump START
Then,
vCont ;r START,START
always single-steps once, and only once, instead of
continuously single-stepping that instruction without
reporting to GDB.
> If so, we should describe them as
> exceptions, not use them as evidence for the rule (which they
> evidently violate).
>
> Or did I misunderstand again?
--
Pedro Alves
next prev parent reply other threads:[~2013-05-15 12:39 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-14 19:10 [PATCH 0/5 V3] target-assisted range stepping Pedro Alves
2013-05-14 19:10 ` [PATCH 4/5] range stepping: gdbserver (x86 GNU/Linux) Pedro Alves
2013-05-14 19:47 ` Eli Zaretskii
2013-05-14 20:14 ` Tom Tromey
2013-05-23 17:44 ` Pedro Alves
2013-05-24 11:33 ` Pedro Alves
2013-05-15 12:14 ` Yao Qi
2013-05-20 18:01 ` Pedro Alves
2013-05-23 0:56 ` Yao Qi
2013-05-23 17:26 ` Pedro Alves
2013-05-14 19:10 ` [PATCH 2/5] Convert rs->support_vCont_t to a struct Pedro Alves
2013-05-14 19:40 ` Tom Tromey
2013-05-14 19:10 ` [PATCH 1/5] Factor out in-stepping-range checks Pedro Alves
2013-05-14 19:37 ` Tom Tromey
2013-05-14 19:10 ` [PATCH 3/5] range stepping: gdb Pedro Alves
2013-05-14 19:46 ` Eli Zaretskii
2013-05-15 10:23 ` Pedro Alves
2013-05-15 11:22 ` Eli Zaretskii
2013-05-15 12:39 ` Pedro Alves [this message]
2013-05-15 13:46 ` Eli Zaretskii
2013-05-15 13:58 ` Pedro Alves
2013-05-15 18:20 ` Pedro Alves
2013-05-16 6:08 ` Eli Zaretskii
2013-05-20 18:43 ` Pedro Alves
2013-05-20 19:05 ` Eli Zaretskii
2013-05-23 0:47 ` Yao Qi
2013-05-23 17:22 ` Pedro Alves
2013-05-14 19:11 ` [PATCH 5/5] range stepping: tests Pedro Alves
2013-05-22 14:32 ` Yao Qi
2013-05-23 17:34 ` Pedro Alves
2013-05-23 18:03 ` Pedro Alves
2013-05-24 2:27 ` Yao Qi
2013-05-24 9:45 ` Pedro Alves
2013-05-24 9:57 ` Yao Qi
2013-05-14 20:21 ` [PATCH 0/5 V3] target-assisted range stepping Tom Tromey
2013-05-23 17:44 ` Pedro Alves
2013-05-23 1:02 ` Yao Qi
2013-05-23 17:46 ` Pedro Alves
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=519381E9.3020007@redhat.com \
--to=palves@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/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