From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4147 invoked by alias); 3 Oct 2008 00:33:54 -0000 Received: (qmail 4129 invoked by uid 22791); 3 Oct 2008 00:33:53 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.113.40.141) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Oct 2008 00:33:03 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id C4B0167DE; Thu, 2 Oct 2008 17:33:01 -0700 (PDT) Received: from [10.20.92.59] (promb-2s-dhcp59.eng.vmware.com [10.20.92.59]) by mailhost2.vmware.com (Postfix) with ESMTP id BAF2C8E567; Thu, 2 Oct 2008 17:33:01 -0700 (PDT) Message-ID: <48E567FA.7010201@vmware.com> Date: Fri, 03 Oct 2008 00:33:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: teawater CC: "gdb@sourceware.org" Subject: Re: Some ideas of displaced step function References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00020.txt.bz2 teawater wrote: > Hi all, > > I read the source code of displaced step and found some fail with it > (http://sourceware.org/ml/gdb/2008-08/msg00231.html). > > I have some ideas on it: > > 1. I think this function just for asynchronous debug. But in acutally, > it be used for any inferior: > /* Return non-zero if displaced stepping is enabled, and can be used > with GDBARCH. */ > static int > use_displaced_stepping (struct gdbarch *gdbarch) > { > return (can_use_displaced_stepping > && gdbarch_displaced_step_copy_insn_p (gdbarch)); > } > Why not let it just work with asynchronous debug? > > 2. This function will affect another code cause it change pc change > memory, but it not supply a get and set interfaces? Most of its > variables are set to static. Just have a can_use_displaced_stepping > can control it disable or enable, but user can set it too. If other > code want know the orig PC or another things, How should they do? > > 3. If get memory fail, it will just output a memory fail directly. > Simple user will not know what happen. But in actually, he can use > "maintenance set can-use-displaced-stepping 0" to jump off this > problem directly. Yes, in fact I have run into this myself. In replay debugging (for instance both Teawater's and VMware's implementation), you can't write to an arbitrary memory location when you're debugging a replay log. Actually it's true with gdb-freeplay too. So I always have to remember to do maint set can-use-displaced-step off before I begin. Why are we using displaced-stepping when we're not async? Isn't it unnecessarily expensive? > So I think maybe can add some clear fail message for example: > Displaced step write memory fail in address 0x....., Maybe you can > jump off with close displaced step function in "maintenance set > can-use-displaced-stepping 0". > > > Thanks, > Hui