Re: RFC: Two small remote protocol extensions

Andrew Cagney
2002-09-27T01:39:51Z

> OK, I suppose that makes sense. It's pretty much where I was to begin
> with: if Hc is non-zero, lock to that thread; if Hc is 0, resume all
> threads, but where do we step? How would you like to see us specify
> this - I used Hs, a new step packet taking a thread argument might work
> too... etc.

Yes, to come full circle, I can see two choices:

- (me back down) and Hg be made as per your proposal - as well as the
registers, it also specify the thread to step when there isn't thread
locking.

- we define something properly

- we modify GDB so that, when asked to step a thread other than current
(i.e., selected) GDB first forces the target to switch to that thread,
and then steps it. This means doing a software single step even though
the hardware might think it has hardware single step.

Separate to this GDB needs to be changed to that resume() has all the
information it needs to implement all of the above operations (and it
isn't relying on that implied global state :-( ).

>
> There's also the question of whether any other simulators or targets
> handle this, and how they behave; I'm not familiar with them. Do they
> treat "HcTID, s" as single-step-one-thread-only? I guess they probably
> do.

I really don't know. (For ``s'', should you be stepping all threads?)

Anyway, I think, to do this right, we're left needing a new packet. Try:

>> > step one, stop others
>
>>
>> Hardware single-step off of breakpoint.
>> TPID, STEP, !OTH
>> HcTID, s

HtTID;s

>> > step one, continue others
>
>>
>> Hardware single-step.
>> TPID, STEP, OTH
>> H???, s

HtPID,0;s
or even:
Ht0;s
I.e., step all threads. Let GDB sort out the mess.

>> > continue one, stop others
>
>>
>> Schedule lock.
>> Software single-step off breakpoint.
>> TPID, !STEP, !OTH (wiered)
>> HcTID, c

HtTID;c

>> > continue one, continue others
>
>>
>> Software single-step.
>> General resume.
>> TPID, !STEP, OTH
>> Hc0, c

Ht0;c
or
c

And also:

HtTID;g
HtTID,TID,TID;Z...
HtTID,TID,TID;c

etc.

Andrew