From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2524 invoked by alias); 24 Sep 2009 19:35:23 -0000 Received: (qmail 2513 invoked by uid 22791); 24 Sep 2009 19:35:22 -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 mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.17.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Sep 2009 19:35:17 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id n8OJZ8t0025828 for ; Thu, 24 Sep 2009 19:35:08 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 n8OJZ7Dt1880144 for ; Thu, 24 Sep 2009 21:35:07 +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 n8OJZ7r1028487 for ; Thu, 24 Sep 2009 21:35:07 +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 n8OJZ6dR028352; Thu, 24 Sep 2009 21:35:06 +0200 Message-Id: <200909241935.n8OJZ6dR028352@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 24 Sep 2009 21:35:06 +0200 Subject: Re: [PATCH] Displaced stepping (non-stop debugging) support for ARM Linux To: julian@codesourcery.com (Julian Brown) Date: Thu, 24 Sep 2009 19:35:00 -0000 From: "Ulrich Weigand" Cc: julian@codesourcery.com (Julian Brown), gdb-patches@sourceware.org, pedro@codesourcery.com (Pedro Alves), drow@false.org (Daniel Jacobowitz) In-Reply-To: <20090731000912.3f3edcdc@rex.config> from "Julian Brown" at Jul 31, 2009 12:09:12 AM 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/msg00756.txt.bz2 Julian Brown wrote: > --- .pc/displaced-stepping-always/gdb/infrun.c 2009-07-30 15:33:13.000000000 -0700 > +++ gdb/infrun.c 2009-07-30 15:33:31.000000000 -0700 > @@ -1105,15 +1111,19 @@ maybe_software_singlestep (struct gdbarc > { > int hw_step = 1; > > - if (gdbarch_software_single_step_p (gdbarch) > - && gdbarch_software_single_step (gdbarch, get_current_frame ())) > + if (gdbarch_software_single_step_p (gdbarch)) > { > - hw_step = 0; > - /* Do not pull these breakpoints until after a `wait' in > - `wait_for_inferior' */ > - singlestep_breakpoints_inserted_p = 1; > - singlestep_ptid = inferior_ptid; > - singlestep_pc = pc; > + if (use_displaced_stepping (gdbarch)) > + hw_step = 0; > + else if (gdbarch_software_single_step (gdbarch, get_current_frame ())) > + { > + hw_step = 0; > + /* Do not pull these breakpoints until after a `wait' in > + `wait_for_inferior' */ > + singlestep_breakpoints_inserted_p = 1; > + singlestep_ptid = inferior_ptid; > + singlestep_pc = pc; > + } > } > return hw_step; > } It seems this change broke displaced stepping on PowerPC. The problem is that on PowerPC, we do have a gdbarch_software_single_step routine (ppc_deal_with_atomic_sequence), but this is only used in very specific circumstances. Usually, it returns zero and lets GDB use hardware single stepping. We also have a displaced stepping implementation, which assumes GDB will use hardware single-stepping to step over the displaced copy (in particular, the gdbarch_software_single_step routine should always return 0 when looking at the displaced copy). However, with the patch, GDB will simply always use "continue" to run the displaced copy, which generally breaks. I'm not sure I understand the rationale behind these changes to the displaced stepping logic in infrun.c in the first place. Why is everything conditioned on gdbarch_software_single_step_p, which just says whether or not the architecture has installed a single-stepping routine -- but this alone doesn't say whether software stepping is actually needed in any given situation ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com