From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5219 invoked by alias); 9 Sep 2014 00:25:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 5208 invoked by uid 89); 9 Sep 2014 00:25:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mout.gmx.net Received: from mout.gmx.net (HELO mout.gmx.net) (212.227.15.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 09 Sep 2014 00:25:39 +0000 Received: from licht.localdomain ([62.158.10.31]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LaFmY-1Y5Srx3pKY-00m5IX; Tue, 09 Sep 2014 02:25:28 +0200 Received: from licht.localdomain (localhost.localdomain [127.0.0.1]) by licht.localdomain (8.12.8/8.12.8) with ESMTP id s890PQRF007195; Tue, 9 Sep 2014 02:25:26 +0200 Received: (from pes@localhost) by licht.localdomain (8.12.8/8.12.8/Submit) id s890PPJo007192; Tue, 9 Sep 2014 02:25:25 +0200 From: Peter Schauer Message-Id: <201409090025.s890PPJo007192@licht.localdomain> Subject: Re: eliminate deprecated_insert_raw_breakpoint. what's left. To: palves@redhat.com (Pedro Alves) Date: Tue, 09 Sep 2014 00:25:00 -0000 Cc: brobecker@adacore.com (Joel Brobecker), gdb-patches@sourceware.org (GDB Patches) In-Reply-To: <540E32AA.70705@redhat.com> from "Pedro Alves" at Sep 08, 2014 11:50:18 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-UI-Out-Filterresults: notjunk:1; X-SW-Source: 2014-09/txt/msg00210.txt.bz2 > > 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 > 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... No, not a bug, but consequences of a very peculiar ptrace implementation, at least up until and including AIX 4.3. See my other post for a more detailed explanation. > I can't believe anything resembling a modern system would need > such a monstrosity! :-) I vote just removing all that. Me too, provided that newer AIX versions have a better ptrace implementation, making this monstrosity unnecessary. -- Peter Schauer Peter.Schauer@mytum.de