From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22250 invoked by alias); 21 Jan 2009 18:07:48 -0000 Received: (qmail 22237 invoked by uid 22791); 21 Jan 2009 18:07:47 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Jan 2009 18:07:41 +0000 Received: (qmail 17475 invoked from network); 21 Jan 2009 18:07:39 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 21 Jan 2009 18:07:39 -0000 From: Pedro Alves To: Julian Brown Subject: Re: [PATCH] Displaced stepping (non-stop debugging) support for ARM Linux Date: Wed, 21 Jan 2009 18:07:00 -0000 User-Agent: KMail/1.9.10 Cc: gdb-patches@sourceware.org References: <20090120221355.46ac23e6@rex.config> In-Reply-To: <20090120221355.46ac23e6@rex.config> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901211808.32127.pedro@codesourcery.com> 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: 2009-01/txt/msg00438.txt.bz2 Hi Julian, On Tuesday 20 January 2009 22:13:55, Julian Brown wrote: > As a side-effect of the lack of h/w single-stepping support, we've > enabled displaced stepping in all cases, not just when stepping over > breakpoints (a patch of Pedro Alves's, attached, but mangled by me to > apply to mainline). I'm not sure if that's the most sensible approach > (for displaced stepping, we only care about not *removing* breakpoints > which might be hit by other threads. We can still add temporary > breakpoints for the purpose of software single-stepping). Right, you may end up with a temporary breakpoint over another breakpoint, though. It would be better to use the standard software single-stepping (set temp break at next pc, continue, remove break) for standard stepping requests, and use displaced stepping only for stepping over breakpoints. Unfortunately, you don't get that for free --- infrun.c and friends don't know how to handle multiple simultaneous software single-stepping requests, and that is required in non-stop mode. On Tuesday 20 January 2009 22:13:55, Julian Brown wrote: > 2008-11-19 Pedro Alves > > * infrun.c (displaced_step_fixup): If this is a software > single-stepping arch, don't tell the target to single-step. > (resume): If this is a software single-stepping arch, and > displaced-stepping is enabled, use it for all single-step > requests. By default, displaced stepping is only enabled in non-stop mode, so, I'm fine with this being placed in the tree, as an incremental step. This should not affect standard all-stop mode. It is a step in the right direction, IMO. You'll need someone else to look over the ARM bits. I wouldn't mind at all if you added a general description of what you're doing to arm-tdep.c, though. Perhaps, even based on: On Tuesday 20 January 2009 22:13:55, Julian Brown wrote: > ARM support is relatively tricky compared to some other architectures, > because there's no hardware single-stepping support. However we can > fake it by making sure that displaced instructions don't modify control > flow, and placing a software breakpoint after each displaced > instruction. Also registers are rewritten to handle instructions which > might read/write the PC. We must of course take care that the cleanup > routine puts things back in the correct places. -- Pedro Alves