From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10713 invoked by alias); 28 Sep 2009 17:27:13 -0000 Received: (qmail 10698 invoked by uid 22791); 28 Sep 2009 17:27:12 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.17.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Sep 2009 17:27:07 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.1/8.13.1) with ESMTP id n8SHR4Xf030246 for ; Mon, 28 Sep 2009 17:27:04 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n8SHR4as3260480 for ; Mon, 28 Sep 2009 19:27:04 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n8SHR4EK016328 for ; Mon, 28 Sep 2009 19:27:04 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id n8SHR3oW016296; Mon, 28 Sep 2009 19:27:03 +0200 Message-Id: <200909281727.n8SHR3oW016296@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 28 Sep 2009 19:27:03 +0200 Subject: Re: [rfc] Fix PowerPC displaced stepping regression To: pedro@codesourcery.com (Pedro Alves) Date: Mon, 28 Sep 2009 17:27:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, julian@codesourcery.com (Julian Brown), drow@false.org (Daniel Jacobowitz) In-Reply-To: <200909281757.49385.pedro@codesourcery.com> from "Pedro Alves" at Sep 28, 2009 05:57:48 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-09/txt/msg00870.txt.bz2 Pedro Alves wrote: Sorry, I missed one additional point: > So, displaced_step_prepare would propagate the "continue" vs > "step" up, and all its callers would do the old logic: > > if (step) > { > if (gdbarch_software_single_step_p (gdbarch)) > target_resume (ptid, 0, TARGET_SIGNAL_0); > else > target_resume (ptid, 1, TARGET_SIGNAL_0); > } > else > target_resume (ptid, 0, TARGET_SIGNAL_0); > > ... that is, we'd remove the checks for use_displaced_stepping from > maybe_software_singlestep, and use something like the > above in displaced_step_fixup, where we issue the target_resume > (with `step' being what gdbarch_displaced_step_copy_insn reported > it wanted). Maybe I misunderstood your point here, but I don't think we can actually do SW single-step on the displaced copy (using the normal SW single-step mechanism). The way SW single-step ususally works is to place breakpoints at all potential branch targets. But if we have a displaced PC-relative branch, for example, the branch target may not even point to addressable memory, so we cannot put breakpoints there. It seems best to never call maybe_software_single_step on displaced copies, like my patch does. If the target wants to place breakpoint instructions somewhere in there, it can do so during copy_insn. Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com