Arm/AArch64: Split DISPLACED_MODIFIED_INSNS name clash
authorAlan Hayward <alan.hayward@arm.com>
Thu, 4 Jul 2019 11:41:20 +0000 (12:41 +0100)
committerAlan Hayward <alan.hayward@arm.com>
Thu, 4 Jul 2019 11:47:26 +0000 (12:47 +0100)
Both targets define DISPLACED_MODIFIED_INSNS, each with different values.
Add ARM_ and AARCH64_ to the start of the name to prevent confusion.

No functionality changes.

gdb/ChangeLog:

* aarch64-linux-tdep.c (aarch64_linux_init_abi): Use
AARCH64_DISPLACED_MODIFIED_INSNS.
* aarch64-tdep.c (struct aarch64_displaced_step_data)
(aarch64_displaced_step_copy_insn): Likewise.
* aarch64-tdep.h (DISPLACED_MODIFIED_INSNS): Rename from..
(AARCH64_DISPLACED_MODIFIED_INSNS): ...to this.
* arm-linux-tdep.c (arm_linux_cleanup_svc): Use
ARM_DISPLACED_MODIFIED_INSNS.
* arm-tdep.c (arm_gdbarch_init): Likewise.
* arm-tdep.h (DISPLACED_MODIFIED_INSNS): Rename from..
(ARM_DISPLACED_MODIFIED_INSNS): ...to this.
(struct arm_displaced_step_closure): Use
ARM_DISPLACED_MODIFIED_INSNS.

gdb/ChangeLog
gdb/aarch64-linux-tdep.c
gdb/aarch64-tdep.c
gdb/aarch64-tdep.h
gdb/arm-linux-tdep.c
gdb/arm-tdep.c
gdb/arm-tdep.h

index 795d44232a5f049cf44233e6ab056a7fa6629ef2..ae1b4f3b782e2d65c2b518ca4023f15d5f1d2f68 100644 (file)
@@ -1,3 +1,19 @@
+2019-07-04  Alan Hayward  <alan.hayward@arm.com>
+
+       * aarch64-linux-tdep.c (aarch64_linux_init_abi): Use
+       AARCH64_DISPLACED_MODIFIED_INSNS.
+       * aarch64-tdep.c (struct aarch64_displaced_step_data)
+       (aarch64_displaced_step_copy_insn): Likewise.
+       * aarch64-tdep.h (DISPLACED_MODIFIED_INSNS): Rename from..
+       (AARCH64_DISPLACED_MODIFIED_INSNS): ...to this.
+       * arm-linux-tdep.c (arm_linux_cleanup_svc): Use
+       ARM_DISPLACED_MODIFIED_INSNS.
+       * arm-tdep.c (arm_gdbarch_init): Likewise.
+       * arm-tdep.h (DISPLACED_MODIFIED_INSNS): Rename from..
+       (ARM_DISPLACED_MODIFIED_INSNS): ...to this.
+       (struct arm_displaced_step_closure): Use
+       ARM_DISPLACED_MODIFIED_INSNS.
+
 2019-07-04  Alan Hayward  <alan.hayward@arm.com>
 
        * features/Makefile: Remove unused xml files.
index 7f2193f2fa5781ef4ee1f78828f749efa5671f8b..831e62fb863248e5cde9985cc8dfa91457597e3d 100644 (file)
@@ -1658,7 +1658,7 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_get_syscall_number (gdbarch, aarch64_linux_get_syscall_number);
 
   /* Displaced stepping.  */
-  set_gdbarch_max_insn_length (gdbarch, 4 * DISPLACED_MODIFIED_INSNS);
+  set_gdbarch_max_insn_length (gdbarch, 4 * AARCH64_DISPLACED_MODIFIED_INSNS);
   set_gdbarch_displaced_step_copy_insn (gdbarch,
                                        aarch64_displaced_step_copy_insn);
   set_gdbarch_displaced_step_fixup (gdbarch, aarch64_displaced_step_fixup);
index b945697fad34172fe7491b7bcd80444cfc836428..17f5e1ee4580f1a0104981924e0a5af9786bab9a 100644 (file)
@@ -2756,7 +2756,7 @@ struct aarch64_displaced_step_data
   /* The address where the instruction will be executed at.  */
   CORE_ADDR new_addr;
   /* Buffer of instructions to be copied to NEW_ADDR to execute.  */
-  uint32_t insn_buf[DISPLACED_MODIFIED_INSNS];
+  uint32_t insn_buf[AARCH64_DISPLACED_MODIFIED_INSNS];
   /* Number of instructions in INSN_BUF.  */
   unsigned insn_count;
   /* Registers when doing displaced stepping.  */
@@ -3000,7 +3000,7 @@ aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch,
   dsd.insn_count = 0;
   aarch64_relocate_instruction (insn, &visitor,
                                (struct aarch64_insn_data *) &dsd);
-  gdb_assert (dsd.insn_count <= DISPLACED_MODIFIED_INSNS);
+  gdb_assert (dsd.insn_count <= AARCH64_DISPLACED_MODIFIED_INSNS);
 
   if (dsd.insn_count != 0)
     {
index f73392d59bf72b0f7ed01a4c308d129163b18d4d..e4b045b599966adf91a375fa1c4d880ce14e3457 100644 (file)
@@ -56,7 +56,7 @@ struct regset;
 
 /* The maximum number of modified instructions generated for one
    single-stepped instruction.  */
-#define DISPLACED_MODIFIED_INSNS 1
+#define AARCH64_DISPLACED_MODIFIED_INSNS 1
 
 /* Target-dependent structure in gdbarch.  */
 struct gdbarch_tdep
index a5ad06434c230ed2e0af42ec5aa3694d28361b7d..8c0c0585d7231897861ea5a8614f23dadcde5b3b 100644 (file)
@@ -954,7 +954,7 @@ arm_linux_cleanup_svc (struct gdbarch *gdbarch,
 
   within_scratch = (apparent_pc >= dsc->scratch_base
                    && apparent_pc < (dsc->scratch_base
-                                     + DISPLACED_MODIFIED_INSNS * 4 + 4));
+                                     + ARM_DISPLACED_MODIFIED_INSNS * 4 + 4));
 
   if (debug_displaced)
     {
index d244707210628ab045f677c0cbad3d8b0c6d6269..42fa1b251e26e4dbf386634148dae0db8fa6dc31 100644 (file)
@@ -9268,7 +9268,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Note: for displaced stepping, this includes the breakpoint, and one word
      of additional scratch space.  This setting isn't used for anything beside
      displaced stepping at present.  */
-  set_gdbarch_max_insn_length (gdbarch, 4 * DISPLACED_MODIFIED_INSNS);
+  set_gdbarch_max_insn_length (gdbarch, 4 * ARM_DISPLACED_MODIFIED_INSNS);
 
   /* This should be low enough for everything.  */
   tdep->lowest_pc = 0x20;
index 23dd40ea8beb1b00289a4cd4e65647399d351580..7da11656c273dff4bffa2156462c8a5d836bdc30 100644 (file)
@@ -152,7 +152,7 @@ struct gdbarch_tdep
 /* The maximum number of modified instructions generated for one single-stepped
    instruction, including the breakpoint (usually at the end of the instruction
    sequence) and any scratch words, etc.  */
-#define DISPLACED_MODIFIED_INSNS       8
+#define ARM_DISPLACED_MODIFIED_INSNS   8
 
 struct arm_displaced_step_closure : public displaced_step_closure
 {
@@ -215,7 +215,7 @@ struct arm_displaced_step_closure : public displaced_step_closure
      - ARM instruction occupies one slot,
      - Thumb 16 bit instruction occupies one slot,
      - Thumb 32-bit instruction occupies *two* slots, one part for each.  */
-  unsigned long modinsn[DISPLACED_MODIFIED_INSNS];
+  unsigned long modinsn[ARM_DISPLACED_MODIFIED_INSNS];
   int numinsns;
   CORE_ADDR insn_addr;
   CORE_ADDR scratch_base;
This page took 0.031882 seconds and 4 git commands to generate.