From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18553 invoked by alias); 22 Apr 2004 18:49:21 -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 18518 invoked from network); 22 Apr 2004 18:49:19 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 22 Apr 2004 18:49:19 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i3MInHKG002810 for ; Thu, 22 Apr 2004 14:49:17 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i3MInEw04264; Thu, 22 Apr 2004 14:49:14 -0400 Received: from redhat.com (dhcp-172-16-25-160.sfbay.redhat.com [172.16.25.160]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id i3MInDC27626; Thu, 22 Apr 2004 11:49:13 -0700 Message-ID: <408813A9.6000402@redhat.com> Date: Thu, 22 Apr 2004 18:49:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.4.2) Gecko/20040301 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com CC: cagney , Daniel Jacobowitz Subject: [RFA] mips 32/64 register/stack fix Content-Type: multipart/mixed; boundary="------------080204060306010807010701" X-RedHat-Spam-Score: 0 X-SW-Source: 2004-04/txt/msg00535.txt.bz2 This is a multi-part message in MIME format. --------------080204060306010807010701 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 664 Hi Andrew, Daniel, This patch applies to the case where you have a mips64 target (eg. mipsisa64-elf), but you're compiling in 32 bit mode (gcc -mips32). In this case mips_regsize (gdbarch) is 64, but mips_saved_regsize (tdep) is 32 (ie. only 32 bits are used to save a register on the stack). trad_frame_prev_register can't handle that case (AFAICT), because it relies on what the regcache says about the regsize. So I've added come code to mips_mdebug_frame_prev_register to handle it. This fixes at least 500 testsuite failures, and in fact makes the results for -mips32 almost identical with the results for -mips64 (they were woefully different before). --------------080204060306010807010701 Content-Type: text/plain; name="mips2" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mips2" Content-length: 2363 2004-04-22 Michael Snyder * mips-tdep.c (mips_mdebug_frame_prev_register): Don't call trad_frame_prev_register when stack-save-size is not equal to register-size. Index: mips-tdep.c =================================================================== RCS file: /cvs/cvsfiles/gnupro/gdb/mips-tdep.c,v retrieving revision 1.11 diff -p -r1.11 mips-tdep.c *** mips-tdep.c 14 Apr 2004 00:54:43 -0000 1.11 --- mips-tdep.c 22 Apr 2004 01:01:34 -0000 *************** mips_mdebug_frame_prev_register (struct *** 1684,1693 **** enum lval_type *lvalp, CORE_ADDR *addrp, int *realnump, void *valuep) { struct mips_frame_cache *info = mips_mdebug_frame_cache (next_frame, this_cache); ! trad_frame_prev_register (next_frame, info->saved_regs, regnum, ! optimizedp, lvalp, addrp, realnump, valuep); } static const struct frame_unwind mips_mdebug_frame_unwind = --- 1684,1719 ---- enum lval_type *lvalp, CORE_ADDR *addrp, int *realnump, void *valuep) { + struct gdbarch *gdbarch = get_frame_arch (next_frame); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); struct mips_frame_cache *info = mips_mdebug_frame_cache (next_frame, this_cache); ! if (mips_saved_regsize (tdep) < mips_regsize (gdbarch) && ! trad_frame_addr_p (info->saved_regs, regnum)) ! { ! char tmp[MAX_REGISTER_SIZE]; ! /* The register was saved in memory, but the size on the stack ! is not the same as the size in the regcache. Trad_frame ! cannot handle this case. */ ! *optimizedp = 0; ! *lvalp = lval_memory; ! *addrp = info->saved_regs[regnum].addr; ! *realnump = -1; ! if (valuep != NULL) ! { ! /* Clear the input buffer, read the value into it from memory ! (offset by the difference between its size on the stack and ! its size in the register). */ ! get_frame_memory (next_frame, info->saved_regs[regnum].addr, ! tmp, mips_saved_regsize (tdep)); ! store_signed_integer (valuep, mips_regsize (gdbarch), ! extract_signed_integer (tmp, ! mips_saved_regsize (tdep))); ! } ! } ! else ! trad_frame_prev_register (next_frame, info->saved_regs, regnum, ! optimizedp, lvalp, addrp, realnump, valuep); } static const struct frame_unwind mips_mdebug_frame_unwind = --------------080204060306010807010701--