From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15907 invoked by alias); 9 Apr 2012 15:10:23 -0000 Received: (qmail 15898 invoked by uid 22791); 9 Apr 2012 15:10:22 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL 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; Mon, 09 Apr 2012 15:10:09 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SHGEK-000492-N2 from Luis_Gustavo@mentor.com for gdb-patches@sourceware.org; Mon, 09 Apr 2012 08:10:08 -0700 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 9 Apr 2012 08:09:58 -0700 Received: from [0.0.0.0] ([172.16.63.104]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 9 Apr 2012 08:10:08 -0700 Message-ID: <4F82FBA1.8070402@mentor.com> Date: Mon, 09 Apr 2012 15:10: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> <4F68E9B1.5040308@mentor.com> <4F827785.2030207@codesourcery.com> In-Reply-To: <4F827785.2030207@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-04/txt/msg00145.txt.bz2 On 04/09/2012 02:45 AM, Yao Qi wrote: > On 03/21/2012 04:33 AM, Luis Gustavo wrote: >> 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? > > Yes, that is what gdbarch_displaced_step_hw_singlestep for, AFAIK. I am > sorry I don't understand how gdbarch_displaced_step_hw_singlestep > related to your patch here. > It is not directly related. I raised that one based on your comment about some targets not being able to HW single-step a group of instructions in the scratch pad. In that case, they should report 0 for gdbarch_displaced_step_hw_singlestep. My target reports 1 for gdbarch_displaced_step_hw_singlestep, and thus HW single-stepping should be used when doing displaced stepping. The patch addresses a different problem, namely the overriding of the STEP variable's value (originally containing gdbarch_displaced_step_hw_singlestep ()'s result) with this call... if (step && breakpoint_inserted_here_p (aspace, pc)) step = 0; If we are trying to step-over a breakpoint using displaced stepping, breakpoint_inserted_here_p (aspace, pc) will obviously return true, thus we disable stepping by setting it to 0. This looks wrong. This has the effect of issuing a vCont;c packet to the remote target instead of vCont;s. By changing the order of the statements in the code, we address this in, hopefully, the correct way. Unless there is some magic going on there. Regards, Luis