From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7839 invoked by alias); 25 Jan 2007 19:23:52 -0000 Received: (qmail 7830 invoked by uid 22791); 25 Jan 2007 19:23:51 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 25 Jan 2007 19:23:45 +0000 Received: (qmail 15813 invoked from network); 25 Jan 2007 19:23:44 -0000 Received: from unknown (HELO 85-210-32-53.dsl.pipex.com) (paul@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Jan 2007 19:23:44 -0000 From: Paul Brook To: gdb-patches@sourceware.org Subject: ARM singlestep bug Date: Thu, 25 Jan 2007 19:23:00 -0000 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701251923.41153.paul@codesourcery.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-01/txt/msg00522.txt.bz2 The patch below fixes a bug in arm_get_next_pc. The test for the BX instruction was incorrectly including the first bit of the condition code. Bit 28 is clear on unconditonal BX instructions, so it works by chance most of the time. Ok? Paul 2007-01-25 Paul Brook gdb/ * arm-tdep.c (arm_get_next_pc): Fix bitfield off-by-one error. Index: gdb/arm-tdep.c =================================================================== --- gdb/arm-tdep.c (revision 158575) +++ gdb/arm-tdep.c (working copy) @@ -1693,8 +1693,8 @@ arm_get_next_pc (CORE_ADDR pc) error (_("Invalid update to pc in instruction")); /* BX , BLX */ - if (bits (this_instr, 4, 28) == 0x12fff1 - || bits (this_instr, 4, 28) == 0x12fff3) + if (bits (this_instr, 4, 27) == 0x12fff1 + || bits (this_instr, 4, 27) == 0x12fff3) { rn = bits (this_instr, 0, 3); result = (rn == 15) ? pc_val + 8 : read_register (rn);