[PATCH] Fix displaced stepping for remote targets

Luis Gustavo luis_gustavo@mentor.com
Tue Mar 20 20:34:00 GMT 2012


On 03/20/2012 03:53 AM, Yao Qi wrote:
> On 03/20/2012 12:38 PM, Luis Gustavo wrote:
>> On 03/20/2012 01:34 AM, Yao Qi wrote:
>>> On 03/20/2012 10:02 AM, Luis Gustavo wrote:
>>>> If a target supports hw single-stepping for displaced stepping, GDB
>>>> should just send a vCont;s packet to tell the target to step a single
>>>> instruction. In my case, GDB was always sending a vCont;c instead.
>>>
>>> On some arch, the original instruction may be translated to more than
>>> one instructions, and copied to scratch pad.  So, we can't do
>>> single-step in scratch pad.
>>
>> During a few tests x86 seems to do single-stepping in the scratch pad
>> when using displaced stepping, or at least it sends the correct vCont;s
>> packet.
>>
>
> GDB writes only one instruction in scratch pad on i386 and amd64.  That
> may be the reason why no fail shows up.
>

Yes, most probably. I think ppc does this as well.

If a target can't use hw single-stepping to execute instructions in the 
scratch pad, i think it should disallow it by returning 0 in 
gdbarch_displaced_step_hw_singlestep. Does it make sense?

Luis



More information about the Gdb-patches mailing list