From 034f1a812d8f5655d08e2bdeb5ec7d56caa40d41 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Wed, 21 Oct 2015 15:50:55 +0100 Subject: [PATCH] Initialize field insn_count correctly This patch initialize dsd.insn_count, otherwise, it triggers the assert below on testings we did recently. gdb: 2015-10-23 Yao Qi * aarch64-tdep.c (aarch64_displaced_step_copy_insn): Set dsd.insn_count to zero. --- gdb/ChangeLog | 5 +++++ gdb/aarch64-tdep.c | 1 + 2 files changed, 6 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9e82e2f33c1..295ad96c1bb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2015-10-23 Yao Qi + + * aarch64-tdep.c (aarch64_displaced_step_copy_insn): Set + dsd.insn_count to zero. + 2015-10-22 Pedro Alves * infrun.c (stop_after_trap): Delete. diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 995cbcf5427..55c5fb86fcc 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -2818,6 +2818,7 @@ aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch, dsd.new_addr = to; dsd.regs = regs; dsd.dsc = dsc; + dsd.insn_count = 0; aarch64_relocate_instruction (insn, &visitor, (struct aarch64_insn_data *) &dsd); gdb_assert (dsd.insn_count <= DISPLACED_MODIFIED_INSNS); -- 2.30.2