From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3249 invoked by alias); 11 Oct 2004 01:35:51 -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 3241 invoked from network); 11 Oct 2004 01:35:51 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 11 Oct 2004 01:35:51 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i9B1ZkSF029644 for ; Sun, 10 Oct 2004 21:35:46 -0400 Received: from localhost.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9B1Zhr26211; Sun, 10 Oct 2004 21:35:43 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id CFCC928CD; Sun, 10 Oct 2004 21:35:24 -0400 (EDT) Message-ID: <4169E35C.2050007@gnu.org> Date: Mon, 11 Oct 2004 01:35:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20041009 MIME-Version: 1.0 To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/mips] Remove mips16 code that seems redundant References: <20041011011652.GW26446@gnat.com> In-Reply-To: <20041011011652.GW26446@gnat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00178.txt.bz2 This? /* The entry instruction is typically the first instruction in a function, and it stores registers at offsets relative to the value of the old SP (before the prologue). But the value of the sp parameter to this function is the new SP (after the prologue has been executed). So we can't calculate those offsets until we've seen the entire prologue, and can calculate what the old SP must have been. */ if (entry_inst != 0) { int areg_count = (entry_inst >> 8) & 7; int sreg_count = (entry_inst >> 6) & 3; /* The entry instruction always subtracts 32 from the SP. */ PROC_FRAME_OFFSET (&temp_proc_desc) += 32; /* Now we can calculate what the SP must have been at the start of the function prologue. */ sp += PROC_FRAME_OFFSET (&temp_proc_desc); /* Check if a0-a3 were saved in the caller's argument save area. */ for (reg = 4, offset = 0; reg < areg_count + 4; reg++) { PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; set_reg_offset (this_cache, reg, sp + offset); offset += mips_abi_regsize (current_gdbarch); } /* Check if the ra register was pushed on the stack. */ offset = -4; if (entry_inst & 0x20) { PROC_REG_MASK (&temp_proc_desc) |= 1 << RA_REGNUM; set_reg_offset (this_cache, RA_REGNUM, sp + offset); offset -= mips_abi_regsize (current_gdbarch); } /* Check if the s0 and s1 registers were pushed on the stack. */ for (reg = 16; reg < sreg_count + 16; reg++) { PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; set_reg_offset (this_cache, reg, sp + offset); offset -= mips_abi_regsize (current_gdbarch); } } yes, the code should have only one loop. Andrew