From patchwork Mon Aug 17 13:28:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Langlois X-Patchwork-Id: 8239 Received: (qmail 36231 invoked by alias); 17 Aug 2015 13:29:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 36221 invoked by uid 89); 17 Aug 2015 13:29:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Aug 2015 13:29:14 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-14-M3EW6ryDTUOouFDznECfRQ-1; Mon, 17 Aug 2015 14:29:09 +0100 Received: from e105615-lin.cambridge.arm.com ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 17 Aug 2015 14:29:09 +0100 From: Pierre Langlois To: gdb-patches@sourceware.org Cc: Pierre Langlois Subject: [PATCH] [AArch64] Fix incorrect mask when decoding b.cond instruction Date: Mon, 17 Aug 2015 14:28:41 +0100 Message-Id: <1439818121-11050-1-git-send-email-pierre.langlois@arm.com> X-MC-Unique: M3EW6ryDTUOouFDznECfRQ-1 X-IsSubscribed: yes Hi all, The encoding of the b.cond instruction is described in the architecture reference manual as: b.cond 0101 0100 iiii iiii iiii iiii iii0 cccc So the mask should be 0xff000010. Thanks, Pierre gdb/ChangeLog: * aarch64-tdep.c (decode_bcond): Fix incorrect mask. --- gdb/aarch64-tdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index c722dc5..e065378 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -339,7 +339,8 @@ decode_b (CORE_ADDR addr, uint32_t insn, int *is_bl, int32_t *offset) static int decode_bcond (CORE_ADDR addr, uint32_t insn, unsigned *cond, int32_t *offset) { - if (decode_masked_match (insn, 0xfe000000, 0x54000000)) + /* b.cond 0101 0100 iiii iiii iiii iiii iii0 cccc */ + if (decode_masked_match (insn, 0xff000010, 0x54000000)) { *cond = (insn >> 0) & 0xf; *offset = extract_signed_bitfield (insn, 19, 5) << 2;