public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Alan Hayward <alahay01@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Arm/AArch64: Split DISPLACED_MODIFIED_INSNS name clash
Date: Thu, 04 Jul 2019 11:53:00 -0000	[thread overview]
Message-ID: <20190704115318.26274.qmail@sourceware.org> (raw)

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

commit e935475cb6bcd8146717896e88824ae93a0897c7
Author: Alan Hayward <alan.hayward@arm.com>
Date:   Thu Jul 4 12:41:20 2019 +0100

    Arm/AArch64: Split DISPLACED_MODIFIED_INSNS name clash
    
    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.

Diff:
---
 gdb/ChangeLog            | 16 ++++++++++++++++
 gdb/aarch64-linux-tdep.c |  2 +-
 gdb/aarch64-tdep.c       |  4 ++--
 gdb/aarch64-tdep.h       |  2 +-
 gdb/arm-linux-tdep.c     |  2 +-
 gdb/arm-tdep.c           |  2 +-
 gdb/arm-tdep.h           |  4 ++--
 7 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 795d442..ae1b4f3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,21 @@
 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.
 	* features/aarch64.xml: Remove.
 	* features/i386/amd64-avx-avx512-linux.xml: Remove.
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 7f2193f..831e62f 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -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);
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index b945697..17f5e1e 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -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)
     {
diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h
index f73392d..e4b045b 100644
--- a/gdb/aarch64-tdep.h
+++ b/gdb/aarch64-tdep.h
@@ -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
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index a5ad064..8c0c058 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -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)
     {
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index d244707..42fa1b2 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -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;
diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h
index 23dd40e..7da1165 100644
--- a/gdb/arm-tdep.h
+++ b/gdb/arm-tdep.h
@@ -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;


                 reply	other threads:[~2019-07-04 11:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190704115318.26274.qmail@sourceware.org \
    --to=alahay01@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).