eliminate deprecated_insert_raw_breakpoint. what's left.

Pedro Alves palves@redhat.com
Mon Sep 8 22:50:00 GMT 2014


On 09/08/2014 10:34 PM, Joel Brobecker wrote:

> I was looking at how to replace that call, but I am not sure
> how to fix the code up, though. Perhaps we could just write
> the breakpoint instruction in by hand, rather than go through
> the breakpoint module? After all, it is already doing almost
> everything else by hand!

Indeed.

> In fact, looking at the code again now, I'm a little more tempted
> to see what happens if we remove it ;-).

Me too.  And seriously.  :-)

I traced it back to I think the original rs6000 port, in 1991...

commit 41abdfbd2de07837ba8088092765154eaa66351d
Author: John Gilmore <gnu@cygnus>
Date:   Tue Nov 12 15:50:47 1991 +0000

    * rs6000-pinsn.c, rs6000-tdep.c, rs6000-xdep.c, tm-rs6000.h,
    xm-rs6000.h:  New files.
    * xcoffexec.c:  New file for handling AIX shared libraries.



We already see this then, in rs6000-xdep.c:

+       /* execute one dummy instruction (which is a breakpoint) in inferior
+          process. So give kernel a chance to do internal house keeping.
+         Otherwise the following ptrace(2) calls will mess up user stack
+         since kernel will get confused about the bottom of the stack (%sp) */
+
+       exec_one_dummy_insn ();


This sounds like working around a (very) old kernel bug...
I can't believe anything resembling a modern system would need
such a monstrosity!  :-)  I vote just removing all that.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list