Re: [patch] "single step" atomic instruction sequences as a whole.

Mark Kettenis
2007-04-14T08:15:23Z

> Date: Thu, 12 Apr 2007 22:43:49 +0200 (CEST)
> From: "Ulrich Weigand" <uweigand@de.ibm.com>
>
> Mark Kettenis wrote:
>
> > I suspect the write_pc call is there to make stepping delay-slot
> > instructions work.
>
> Maybe I'm confused, but I thought alpha didn't have delay slots?
> There is a special gdbarch routine single_step_through_delay for
> targets that have those ...

Duh, you're right. I must have been hacking tto much on sparc64 and
mips64 lately.

> > > I don't have a way to test on alpha-linux unfortunately. Do you?
> >
> > I can test OpenBSD/alpha later this week if necessary.
>
> Thanks for the offer! (I just noticed that Linux/alpha doesn't use
> software single-step anyway, but OpenBSD/alpha does.)

Indeed.

> Would you mind testing this small patch that simply removes the
> write_pc call?

It actually gets rid of a couple of FAILs. So please go ahead and
commit this.

> * alpha-tdep.c (alpha_software_single_step): Do not call write_pc
> when removing single-step breakpoints.
>
> Index: gdb/alpha-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
> retrieving revision 1.163
> diff -u -p -r1.163 alpha-tdep.c
> --- gdb/alpha-tdep.c 12 Apr 2007 14:52:19 -0000 1.163
> +++ gdb/alpha-tdep.c 12 Apr 2007 20:39:08 -0000
> @@ -1521,7 +1521,7 @@ alpha_next_pc (CORE_ADDR pc)
> int
> alpha_software_single_step (enum target_signal sig, int insert_breakpoints_p)
> {
> - static CORE_ADDR next_pc;
> + CORE_ADDR next_pc;
> CORE_ADDR pc;
>
> if (insert_breakpoints_p)
> @@ -1534,7 +1534,6 @@ alpha_software_single_step (enum target_
> else
> {
> remove_single_step_breakpoints ();
> - write_pc (next_pc);
> }
> return 1;
> }