From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8595 invoked by alias); 26 Jun 2003 18:00:42 -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 8547 invoked from network); 26 Jun 2003 18:00:41 -0000 Received: from unknown (HELO localhost.redhat.com) (216.129.200.2) by sources.redhat.com with SMTP; 26 Jun 2003 18:00:41 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 7C1442B5F; Thu, 26 Jun 2003 14:00:39 -0400 (EDT) Message-ID: <3EFB34C7.8010409@redhat.com> Date: Thu, 26 Jun 2003 18:00:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Fred Fish Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Don't clobber info->mach in gdb_print_insn_mips References: <20030624005110.4C00F2F2F2C@beeville.vert.intrinsity.com> <3EFA0FA5.70603@redhat.com> Content-Type: multipart/mixed; boundary="------------080506050801060504070609" X-SW-Source: 2003-06/txt/msg00796.txt.bz2 This is a multi-part message in MIME format. --------------080506050801060504070609 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 49 I've checked this in trunk and 6 branch. Andrew --------------080506050801060504070609 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1394 2003-06-26 Andrew Cagney * mips-tdep.c (gdb_print_insn_mips): Only explicitly set info->mach when MIPS16. Patch suggested by Fred Fish. Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.221 diff -u -r1.221 mips-tdep.c --- mips-tdep.c 21 Jun 2003 23:14:43 -0000 1.221 +++ mips-tdep.c 26 Jun 2003 17:58:48 -0000 @@ -5270,12 +5270,20 @@ the procedure descriptor exists and the address therein is odd, it's definitely a 16-bit function. Otherwise, we have to just guess that if the address passed in is odd, it's 16-bits. */ + /* FIXME: cagney/2003-06-26: Is this even necessary? The + disassembler needs to be able to locally determine the ISA, and + not rely on GDB. Otherwize the stand-alone 'objdump -d' will not + work. */ if (proc_desc) - info->mach = pc_is_mips16 (PROC_LOW_ADDR (proc_desc)) ? - bfd_mach_mips16 : 0; + { + if (pc_is_mips16 (PROC_LOW_ADDR (proc_desc))) + info->mach = bfd_mach_mips16; + } else - info->mach = pc_is_mips16 (memaddr) ? - bfd_mach_mips16 : 0; + { + if (pc_is_mips16 (memaddr)) + info->mach = bfd_mach_mips16; + } /* Round down the instruction address to the appropriate boundary. */ memaddr &= (info->mach == bfd_mach_mips16 ? ~1 : ~3); --------------080506050801060504070609--