From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7582 invoked by alias); 10 Sep 2003 21:39:41 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 7544 invoked from network); 10 Sep 2003 21:39:38 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 10 Sep 2003 21:39:38 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id ACE672B89 for ; Wed, 10 Sep 2003 17:39:33 -0400 (EDT) Message-ID: <3F5F9A15.8090801@redhat.com> Date: Wed, 10 Sep 2003 21:39:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [rfa:ppc] Eliminate write_sp, but how? Content-Type: multipart/mixed; boundary="------------000104070409020704090209" X-SW-Source: 2003-09/txt/msg00210.txt.bz2 This is a multi-part message in MIME format. --------------000104070409020704090209 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 937 This one liner isn't obvious. The various ABIs have a requrement that the SP be decremented before writing anything to the stack (ignoring the red zone). This is to stop signal handlers and the like trashing the callers stack. The two PPC push_dummy_call (nee push_arguments) methods are already carefully complying to this requirement (setting SP before using the stack) and hence [deprecated] write_sp method which also sets the SP before a call is entirely redundant. Thing is, I don't see any reason to exactly matching the ABI behavior (that thread is stopped so it won't get anything writing to its stack) and further, I think exactly matching the behavior makes the code harder to understand (I'm having trouble convincing my self that it does what I think it does :-). So, in addition to eliminating deprecated write_sp, would it be ok to move the write SP code to the end of the push_dummy_call methods? Andrew --------------000104070409020704090209 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 733 2003-09-10 Andrew Cagney * rs6000-tdep.c (rs6000_gdbarch_init): Do not set "deprecated_dummy_write_sp". Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.155 diff -u -r1.155 rs6000-tdep.c --- rs6000-tdep.c 9 Sep 2003 22:41:47 -0000 1.155 +++ rs6000-tdep.c 10 Sep 2003 21:03:39 -0000 @@ -2896,7 +2896,6 @@ set_gdbarch_print_insn (gdbarch, gdb_print_insn_powerpc); set_gdbarch_write_pc (gdbarch, generic_target_write_pc); - set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp); set_gdbarch_num_regs (gdbarch, v->nregs); set_gdbarch_num_pseudo_regs (gdbarch, v->npregs); --------------000104070409020704090209--