This is the mail archive of the
mailing list for the GDB project.
Re: eliminate deprecated_insert_raw_breakpoint. what's left.
- From: Pedro Alves <palves at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Mon, 08 Sep 2014 23:50:18 +0100
- Subject: Re: eliminate deprecated_insert_raw_breakpoint. what's left.
- Authentication-results: sourceware.org; auth=none
- References: <540DEB7E dot 3000100 at redhat dot com> <20140908192432 dot GE28404 at adacore dot com> <20140908213427 dot GF28404 at adacore dot com>
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!
> 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...
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.