This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Use aarch64_decode_insn in aarch64_displaced_step_copy_insn


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c86a40c6c2902b73ec6f601176820c760524afd2

commit c86a40c6c2902b73ec6f601176820c760524afd2
Author: Yao Qi <yao.qi@linaro.org>
Date:   Thu Nov 5 09:44:32 2015 +0000

    Use aarch64_decode_insn in aarch64_displaced_step_copy_insn
    
    gdb:
    
    2015-11-05  Yao Qi  <yao.qi@linaro.org>
    
    	* aarch64-tdep.c (aarch64_displaced_step_copy_insn): Call
    	aarch64_decode_insn and decode instruction by aarch64_inst.

Diff:
---
 gdb/ChangeLog      | 5 +++++
 gdb/aarch64-tdep.c | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 93a2950..366ee4c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2015-11-05  Yao Qi  <yao.qi@linaro.org>
 
+	* aarch64-tdep.c (aarch64_displaced_step_copy_insn): Call
+	aarch64_decode_insn and decode instruction by aarch64_inst.
+
+2015-11-05  Yao Qi  <yao.qi@linaro.org>
+
 	* aarch64-tdep.c (extract_signed_bitfield): Remove.
 	(decode_masked_match): Remove.
 	(aarch64_decode_add_sub_imm): Remove.
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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]