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:45:18 +0200 (CEST)
- Subject: Re: [rfc] Fix PowerPC displaced stepping regression
Pedro Alves wrote:
> On Monday 28 September 2009 18:27:03, Ulrich Weigand wrote:
> > 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.
>
> If you get yourself such an instruction in the buffer, usually you'd
> want the branch offset had to be adjusted at displaced copy time,
> otherwise it seems to be you're already broken.
If that's possible. In general, the real branch target may be out of
range relative to the address of the copied instruction for a branch in
the original instruction format ... (You could redirect to some temporary
target in the copy buffer, but at this point you're probably better off
just emulating the whole thing in the first place.)
> But I did post a
> confusing snippet, sorry. All I meant was to have displaced_step_copy
> routine to tell infrun.c to call target_resume(continue), instead
> of target_resume(step). Your version works for that too.
Ah, I see.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com