Hello Luis, From: Luis Machado Subject: Re: [patch] "single step" atomic instruction sequences as a whole. Date: Wed, 28 Feb 2007 13:09:00 -0300 > Also, i haven't been able to reproduce the issue related at this post: > (http://sourceware.org/ml/gdb-patches/2006-09/msg00060.html) I think one of the reasons why is that you didn't build the target as Emre did; 'atomic_dec' seemed to be inline expanded in that target. I could get it with -O3 option of gcc-4.1.0 on my machine running FC5. And I could reproduce the issue with your patch by setting a breakpoint at where 'printf' preceded by 'atomic_dec' is before running the target. But the fix is fairly easy: =================================================================== diff -u rs6000-tdep.c.old rs6000-tdep.c --- rs6000-tdep.c.old 2007-03-02 19:33:12.000000000 +0900 +++ rs6000-tdep.c 2007-03-02 19:34:07.000000000 +0900 @@ -764,7 +764,7 @@ if (last_break && breaks[1] == breaks[0]) last_break = 0; - for (i= 0; i < last_break; ++i) + for (i= 0; i <= last_break; ++i) insert_single_step_breakpoint (breaks[i]); printf_unfiltered (_("Stepping over an atomic sequence of instructions beginning at %s\n"), diff -u ppc-linux-tdep.c.old ppc-linux-tdep.c --- ppc-linux-tdep.c.old 2007-03-02 19:33:33.000000000 +0900 +++ ppc-linux-tdep.c 2007-03-02 19:33:54.000000000 +0900 @@ -996,7 +996,7 @@ if (last_break && breaks[1] == breaks[0]) last_break = 0; - for (i= 0; i < last_break; ++i) + for (i= 0; i <= last_break; ++i) insert_single_step_breakpoint (breaks[i]); printf_unfiltered (_("Stepping over an atomic sequence of instructions beginning at %s\n"), =================================================================== Another thing I want to notice you about Paul's patch is that the patch for ppc-linux-tdep.c is not needed at all: they do exactly the same and RS6000 is the superset of PowerPC. And I think that the load or store instructions which deal with doublewords can be appeared as a part of the atomic sequence; Paul's patch doesn't check it. But maybe not needed for now. BTW, I had another mistake on my patch send last time... Please replace the attached one. My best regards, -- Emi SUZUKI