[remote protocol] step range?

Michael Snyder msnyder@vmware.com
Fri Sep 5 02:39:00 GMT 2008

Hey Jason!   ;-)

Jason Molenda wrote:
> On Sep 4, 2008, at 3:14 PM, Michael Snyder wrote:
>> What about a remote protocol command that says
>> "single step until you leave the range <begin> - <end>".
> I wouldn't imagine any problem with such a packet - but it won't be
> useful on architectures that have variable length instructions (even
> ARM with its mix of ARM and Thumb opcodes) that don't have a hardware-
> supported single-instruction-step capability.  Your remote driver
> would need to contain a disassembler in those cases to do anything
> useful.

I don't think that's necessarily true -- the remote agent
could just do what gdb does, single-step repeatedly and
check the stop pc against the range.

The idea is just to reduce the number of back-and-forth
transactions (but as it so happens, I'm playing with a
target where it would be a *huge* win.)

> There is a lot of overhead and unnecessary communication over a
> typical remote protocol connection that you can eliminate with some
> effort.  But if the problem you're trying to solve is on a platform
> where single-instruction stepping is easy for the remote driver to do,
> this could be a reasonable alternate approach.  I suppose the most
> complicated thing you'd have to worry about is a remote target that
> has multiple threads, with those threads executing when you're trying
> to step through that range, and one of the other threads hitting a
> breakpoint or getting a signal.

Well, if the remote can deal with threads at all (eg. gdbserver),
then it could probably treat this just as gdb would.  A preemptive
stop in another thread would be outside the step range, therefore
we would tell gdb that we stopped.

This was, incidentally, the issue that the last thread on this
subject stalled on.  But I don't see why it isn't soluble...

More information about the Gdb mailing list