From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28008 invoked by alias); 20 Jul 2007 12:53:58 -0000 Received: (qmail 27999 invoked by uid 22791); 20 Jul 2007 12:53:58 -0000 X-Spam-Check-By: sourceware.org Received: from dmz.mips-uk.com (HELO dmz.mips-uk.com) (194.74.144.194) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 20 Jul 2007 12:53:56 +0000 Received: from internal-mx1 ([192.168.192.240] helo=ukservices1.mips.com) by dmz.mips-uk.com with esmtp (Exim 3.35 #1 (Debian)) id 1IBrzV-0000wR-00; Fri, 20 Jul 2007 13:53:53 +0100 Received: from perivale.mips.com ([192.168.192.200]) by ukservices1.mips.com with esmtp (Exim 3.36 #1 (Debian)) id 1IBrzR-00014l-00; Fri, 20 Jul 2007 13:53:49 +0100 Received: from macro (helo=localhost) by perivale.mips.com with local-esmtp (Exim 4.63) (envelope-from ) id 1IBrzR-0003lw-JO; Fri, 20 Jul 2007 13:53:49 +0100 Date: Fri, 20 Jul 2007 13:50:00 -0000 From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: "Maciej W. Rozycki" Subject: mips-tdep.c: Use is_mips16_addr() to test for the MIPS16 mode Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MIPS-Technologies-UK-MailScanner: Found to be clean X-MIPS-Technologies-UK-MailScanner-From: macro@mips.com Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00230.txt.bz2 Hello, We have a function to check whether an address of instruction implies the MIPS16 mode or not. However mips_next_pc() checks that directly. Here is a fix. No regressions for mipsisa32-sde-elf, with mips-sim-sde32/-EB and mips-sim-sde32/-mips16/-EB. 2007-07-20 Maciej W. Rozycki * mips-tdep.c (mips_next_pc): Use is_mips16_addr() instead of a direct test. OK to apply? Maciej gdb-mips_next_pc.diff Index: binutils-quilt/src/gdb/mips-tdep.c =================================================================== --- binutils-quilt.orig/src/gdb/mips-tdep.c 2007-07-19 18:15:07.000000000 +0100 +++ binutils-quilt/src/gdb/mips-tdep.c 2007-07-19 18:27:51.000000000 +0100 @@ -1437,11 +1437,11 @@ target monitor or stub is not developed enough to do a single_step. It works by decoding the current instruction and predicting where a branch will go. This isnt hard because all the data is available. - The MIPS32 and MIPS16 variants are quite different */ + The MIPS32 and MIPS16 variants are quite different. */ static CORE_ADDR mips_next_pc (struct frame_info *frame, CORE_ADDR pc) { - if (pc & 0x01) + if (is_mips16_addr (pc)) return mips16_next_pc (frame, pc); else return mips32_next_pc (frame, pc);