From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7029 invoked by alias); 20 Mar 2012 20:34:28 -0000 Received: (qmail 6868 invoked by uid 22791); 20 Mar 2012 20:34:27 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Mar 2012 20:34:11 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SA5kw-0002km-39 from Luis_Gustavo@mentor.com for gdb-patches@sourceware.org; Tue, 20 Mar 2012 13:34:10 -0700 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by svr-orw-fem-01.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 20 Mar 2012 13:34:09 -0700 Received: from [0.0.0.0] ([172.16.63.104]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 20 Mar 2012 13:34:09 -0700 Message-ID: <4F68E9B1.5040308@mentor.com> Date: Tue, 20 Mar 2012 20:34:00 -0000 From: Luis Gustavo Reply-To: "Gustavo, Luis" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.27) Gecko/20120216 Lightning/1.0b2 Thunderbird/3.1.19 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix displaced stepping for remote targets References: <4F67E54C.1010904@mentor.com> <4F6808C9.7020709@codesourcery.com> <4F6809DB.1010005@mentor.com> <4F68295F.80301@codesourcery.com> In-Reply-To: <4F68295F.80301@codesourcery.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-03/txt/msg00752.txt.bz2 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