This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Fix PowerPC displaced stepping regression
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: pedro at codesourcery dot com (Pedro Alves)
- Cc: gdb-patches at sourceware dot org, julian at codesourcery dot com (Julian Brown), drow at false dot org (Daniel Jacobowitz)
- Date: Mon, 28 Sep 2009 19:27:03 +0200 (CEST)
- Subject: Re: [rfc] Fix PowerPC displaced stepping regression
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