From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6958 invoked by alias); 23 Jun 2003 14:14:17 -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 30293 invoked from network); 23 Jun 2003 13:39:20 -0000 Received: from unknown (HELO mailhost.intrinsity.com) (208.246.32.130) by sources.redhat.com with SMTP; 23 Jun 2003 13:39:20 -0000 Received: from victoria.intrinsity.com (victoria.eng.intrinsity.com [192.168.1.29]) by mailhost.intrinsity.com (Postfix) with ESMTP id E72413F39C for ; Mon, 23 Jun 2003 08:39:19 -0500 (CDT) Received: from beeville.vert.intrinsity.com (beeville.vert.intrinsity.com [192.168.3.48]) by victoria.intrinsity.com (Postfix) with ESMTP id AD9774586C; Mon, 23 Jun 2003 08:39:19 -0500 (CDT) Received: by beeville.vert.intrinsity.com (Postfix, from userid 621) id 2C2E92F2C23; Mon, 23 Jun 2003 13:39:19 +0000 (UTC) Subject: [PATCH] Don't clobber info->mach in gdb_print_insn_mips To: gdb-patches@sources.redhat.com Date: Mon, 23 Jun 2003 14:14:00 -0000 Cc: fnf@intrinsity.com (Fred Fish) Reply-To: fnf@intrinsity.com (Fred Fish) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030623133919.2C2E92F2C23@beeville.vert.intrinsity.com> From: fnf@intrinsity.com (Fred Fish) X-SW-Source: 2003-06/txt/msg00725.txt.bz2 I updated to the latest CVS gdb over the weekend and afterwards my mipsisa32-intrinsity-elf target would no longer disassemble coprocessor 2 instructions correctly. I tracked it down to the info->mach field being clobbered by gdb_print_insn_mips. The attached patch fixes it, though I'm not sure if this is the correct solution. Note that mipsisa32-intrinsity-elf is not yet a supported target configuration as it is a work in progress and the patches have not been submitted yet. But mipsisa32-unknown-elf has a similar problem. -Fred 2003-06-23 Fred Fish * mips-tdep.c (gdb_print_insn_mips): Don't clobber a previously set value of info->mach. Index: mips-tdep.c =================================================================== RCS file: /mips/newtools/fsf/gdb/gdb/mips-tdep.c,v retrieving revision 1.20 diff -c -r1.20 mips-tdep.c *** mips-tdep.c 2003/06/23 02:13:09 1.20 --- mips-tdep.c 2003/06/23 13:33:02 *************** *** 5279,5288 **** guess that if the address passed in is odd, it's 16-bits. */ if (proc_desc) info->mach = pc_is_mips16 (PROC_LOW_ADDR (proc_desc)) ? ! bfd_mach_mips16 : 0; else info->mach = pc_is_mips16 (memaddr) ? ! bfd_mach_mips16 : 0; /* Round down the instruction address to the appropriate boundary. */ memaddr &= (info->mach == bfd_mach_mips16 ? ~1 : ~3); --- 5279,5288 ---- guess that if the address passed in is odd, it's 16-bits. */ if (proc_desc) info->mach = pc_is_mips16 (PROC_LOW_ADDR (proc_desc)) ? ! bfd_mach_mips16 : info->mach; else info->mach = pc_is_mips16 (memaddr) ? ! bfd_mach_mips16 : info->mach; /* Round down the instruction address to the appropriate boundary. */ memaddr &= (info->mach == bfd_mach_mips16 ? ~1 : ~3);