From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85458 invoked by alias); 29 Oct 2015 14:42:20 -0000 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 Received: (qmail 85237 invoked by uid 89); 29 Oct 2015 14:42:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f51.google.com Received: from mail-pa0-f51.google.com (HELO mail-pa0-f51.google.com) (209.85.220.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 29 Oct 2015 14:42:18 +0000 Received: by padhk11 with SMTP id hk11so42916704pad.1 for ; Thu, 29 Oct 2015 07:42:17 -0700 (PDT) X-Received: by 10.68.213.39 with SMTP id np7mr2257151pbc.165.1446129736968; Thu, 29 Oct 2015 07:42:16 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc2-power8.osuosl.org. [140.211.9.43]) by smtp.gmail.com with ESMTPSA id z12sm2831816pbt.30.2015.10.29.07.42.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Oct 2015 07:42:16 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 3/3] Use aarch64_decode_insn in aarch64_displaced_step_copy_insn Date: Thu, 29 Oct 2015 17:09:00 -0000 Message-Id: <1446129722-11855-4-git-send-email-yao.qi@linaro.org> In-Reply-To: <1446129722-11855-1-git-send-email-yao.qi@linaro.org> References: <1446129722-11855-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00692.txt.bz2 gdb: 2015-10-29 Yao Qi * aarch64-tdep.c (aarch64_displaced_step_copy_insn): Call aarch64_decode_insn and decode instruction by aarch64_inst. --- gdb/aarch64-tdep.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 4bdd227..bc282e9 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -2500,9 +2500,13 @@ aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch, enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); uint32_t insn = read_memory_unsigned_integer (from, 4, byte_order_for_code); struct aarch64_displaced_step_data dsd; + aarch64_inst inst; + + if (aarch64_decode_insn (insn, &inst, 1) != 0) + return NULL; /* Look for a Load Exclusive instruction which begins the sequence. */ - if (decode_masked_match (insn, 0x3fc00000, 0x08400000)) + if (inst.opcode->iclass == ldstexcl && bit (insn, 22)) { /* We can't displaced step atomic sequences. */ return NULL; -- 1.9.1