From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: julian@codesourcery.com (Julian Brown)
Cc: julian@codesourcery.com (Julian Brown),
gdb-patches@sourceware.org,
pedro@codesourcery.com (Pedro Alves),
drow@false.org (Daniel Jacobowitz)
Subject: Re: [PATCH] Displaced stepping (non-stop debugging) support for ARM Linux
Date: Thu, 24 Sep 2009 19:35:00 -0000 [thread overview]
Message-ID: <200909241935.n8OJZ6dR028352@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20090731000912.3f3edcdc@rex.config> from "Julian Brown" at Jul 31, 2009 12:09:12 AM
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
next prev parent reply other threads:[~2009-09-24 19:35 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-20 22:14 Julian Brown
2009-01-21 18:07 ` Pedro Alves
2009-02-02 20:01 ` Daniel Jacobowitz
2009-05-16 18:19 ` Julian Brown
2009-06-09 17:37 ` Daniel Jacobowitz
2009-06-10 14:58 ` Pedro Alves
2009-06-10 15:05 ` Daniel Jacobowitz
2009-07-15 19:16 ` Julian Brown
2009-07-24 2:17 ` Daniel Jacobowitz
2009-07-31 11:43 ` Julian Brown
2009-09-24 19:35 ` Ulrich Weigand [this message]
2009-09-27 21:47 ` [rfc] Fix PowerPC displaced stepping regression Ulrich Weigand
2009-09-28 16:57 ` Pedro Alves
2009-09-28 17:12 ` Ulrich Weigand
2009-09-28 17:31 ` Pedro Alves
2009-09-28 17:39 ` Ulrich Weigand
2009-09-28 17:27 ` Ulrich Weigand
2009-09-28 17:39 ` Pedro Alves
2009-09-28 17:45 ` Ulrich Weigand
2009-09-28 19:07 ` Pedro Alves
2009-09-28 19:41 ` Pedro Alves
2009-09-29 0:59 ` Ulrich Weigand
2009-09-29 1:36 ` Joel Brobecker
2009-09-29 12:54 ` Ulrich Weigand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200909241935.n8OJZ6dR028352@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=julian@codesourcery.com \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox