From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6193 invoked by alias); 2 Oct 2008 22:05:03 -0000 Received: (qmail 6138 invoked by uid 22791); 2 Oct 2008 22:05:01 -0000 X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.188) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 02 Oct 2008 22:04:12 +0000 Received: by ti-out-0910.google.com with SMTP id d10so757824tib.12 for ; Thu, 02 Oct 2008 15:04:09 -0700 (PDT) Received: by 10.110.43.20 with SMTP id q20mr223587tiq.14.1222985049520; Thu, 02 Oct 2008 15:04:09 -0700 (PDT) Received: by 10.110.42.9 with HTTP; Thu, 2 Oct 2008 15:04:09 -0700 (PDT) Message-ID: Date: Thu, 02 Oct 2008 22:05:00 -0000 From: teawater To: "gdb@sourceware.org" Subject: Some ideas of displaced step function MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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/msg00019.txt.bz2 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. 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