This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix displaced stepping for remote targets


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.



Even the case that one instruction is generated/copied to scratch pad can be optimized in your approach, but not sure it breaks software-single-step arch or not.


In my case GDB thinks there's a breakpoint right at PC since PC points to the old location. GDB just continues through vCont;c. This does not work as execution will just re-start from the scratch pad area and will cause unpredictable behavior.


Maybe we need a better mechanism for this then.

Luis


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]