Remove simple_displaced_step_copy_insn
authorSimon Marchi <simon.marchi@ericsson.com>
Fri, 13 Oct 2017 01:42:05 +0000 (21:42 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Fri, 13 Oct 2017 01:42:23 +0000 (21:42 -0400)
Nothing uses this function.  Remove it, and adjust comments referring to
it.

gdb/ChangeLog:

* arch-utils.h (simple_displaced_step_copy_insn): Remove.
* arch-utils.c (simple_displaced_step_copy_insn): Remove.
* gdbarch.sh (displaced_step_copy_insn): Adjust comment.
* gdbarch.h: Regenerate.
* i386-linux-tdep.c (i386_linux_displaced_step_copy_insn):
Adjust comment.
* i386-tdep.c (i386_displaced_step_copy_insn): Adjust comment.
(i386_displaced_step_fixup): Adjust comment.
* rs6000-tdep.c (ppc_displaced_step_copy_insn): Adjust comment.

gdb/ChangeLog
gdb/arch-utils.c
gdb/arch-utils.h
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/i386-linux-tdep.c
gdb/i386-tdep.c
gdb/rs6000-tdep.c

index 65a326573719e16f56e2e142f4be6059dad52657..032d8d39cf04625a573b4c42677bcc1d78285c8d 100644 (file)
@@ -1,3 +1,15 @@
+2017-10-12  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * arch-utils.h (simple_displaced_step_copy_insn): Remove.
+       * arch-utils.c (simple_displaced_step_copy_insn): Remove.
+       * gdbarch.sh (displaced_step_copy_insn): Adjust comment.
+       * gdbarch.h: Regenerate.
+       * i386-linux-tdep.c (i386_linux_displaced_step_copy_insn):
+       Adjust comment.
+       * i386-tdep.c (i386_displaced_step_copy_insn): Adjust comment.
+       (i386_displaced_step_fixup): Adjust comment.
+       * rs6000-tdep.c (ppc_displaced_step_copy_insn): Adjust comment.
+
 2017-10-12  Tom Tromey  <tom@tromey.com>
 
        * prologue-value.h (pv_area::store_would_trash): Return bool.
index 02ffd6b574f5fb1c7a80af77ceca0a8ea02b34c1..6bdcc0126d5c6f08f366e5f95460d348e28cd07d 100644 (file)
 
 #include "dis-asm.h"
 
-struct displaced_step_closure *
-simple_displaced_step_copy_insn (struct gdbarch *gdbarch,
-                                 CORE_ADDR from, CORE_ADDR to,
-                                 struct regcache *regs)
-{
-  size_t len = gdbarch_max_insn_length (gdbarch);
-  gdb_byte *buf = (gdb_byte *) xmalloc (len);
-
-  read_memory (from, buf, len);
-  write_memory (to, buf, len);
-
-  if (debug_displaced)
-    {
-      fprintf_unfiltered (gdb_stdlog, "displaced: copy %s->%s: ",
-                          paddress (gdbarch, from), paddress (gdbarch, to));
-      displaced_step_dump_bytes (gdb_stdlog, buf, len);
-    }
-
-  return (struct displaced_step_closure *) buf;
-}
-
 int
 default_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
                                      struct displaced_step_closure *closure)
index fa2908605f5b3956e5c1ebdc619f69c06a0f061b..6d3c3629ef50ac48ee9c7ca4902addee6cbee9b3 100644 (file)
@@ -73,18 +73,6 @@ struct bp_manipulation_endian
   bp_manipulation_endian<sizeof (BREAK_INSN_LITTLE),             \
   BREAK_INSN_LITTLE, BREAK_INSN_BIG>
 
-/* An implementation of gdbarch_displaced_step_copy_insn for
-   processors that don't need to modify the instruction before
-   single-stepping the displaced copy.
-
-   Simply copy gdbarch_max_insn_length (ARCH) bytes from FROM to TO.
-   The closure is an array of that many bytes containing the
-   instruction's bytes, allocated with xmalloc.  */
-extern struct displaced_step_closure *
-  simple_displaced_step_copy_insn (struct gdbarch *gdbarch,
-                                   CORE_ADDR from, CORE_ADDR to,
-                                   struct regcache *regs);
-
 /* Default implementation of gdbarch_displaced_hw_singlestep.  */
 extern int
   default_displaced_step_hw_singlestep (struct gdbarch *,
index f276d09a6612eb159cceda9fa00404f17ebb1df8..d2e6b6f63ecd6de28deb032f259549b20e9411a1 100644 (file)
@@ -984,10 +984,6 @@ extern void set_gdbarch_max_insn_length (struct gdbarch *gdbarch, ULONGEST max_i
    If you do not provide this function, GDB assumes that the
    architecture does not support displaced stepping.
   
-   If your architecture doesn't need to adjust instructions before
-   single-stepping them, consider using simple_displaced_step_copy_insn
-   here.
-  
    If the instruction cannot execute out of line, return NULL.  The
    core falls back to stepping past the instruction in-line instead in
    that case. */
index ea15c8c1b51b90da46db83588e0584ce02400158..6459b12747bb29109c621140f9b853d843308ef6 100755 (executable)
@@ -793,10 +793,6 @@ V;ULONGEST;max_insn_length;;;0;0
 # If you do not provide this function, GDB assumes that the
 # architecture does not support displaced stepping.
 #
-# If your architecture doesn't need to adjust instructions before
-# single-stepping them, consider using simple_displaced_step_copy_insn
-# here.
-#
 # If the instruction cannot execute out of line, return NULL.  The
 # core falls back to stepping past the instruction in-line instead in
 # that case.
index 87a9598f8af2b651e41b7350702ea75047b83e8d..8cec6753f060a85be6dcd3a2767d7854a8d032df 100644 (file)
@@ -803,13 +803,13 @@ i386_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
                                     struct regcache *regs)
 {
   struct displaced_step_closure *closure;
-  
+
   closure = i386_displaced_step_copy_insn (gdbarch, from, to, regs);
 
   if (i386_linux_get_syscall_number_from_regcache (regs) != -1)
     {
-      /* Since we use simple_displaced_step_copy_insn, our closure is a
-        copy of the instruction.  */
+      /* The closure returned by i386_displaced_step_copy_insn is simply a
+         buffer with a copy of the instruction. */
       gdb_byte *insn = (gdb_byte *) closure;
 
       /* Fake nop.  */
index 9eb1192ff5b18f499c915fdddca3587f3b608a32..46e5e32f0a603c1890d114d25d97c68720a96413 100644 (file)
@@ -794,8 +794,7 @@ i386_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr)
   return i386_jmp_p (insn);
 }
 
-/* Some kernels may run one past a syscall insn, so we have to cope.
-   Otherwise this is just simple_displaced_step_copy_insn.  */
+/* Some kernels may run one past a syscall insn, so we have to cope.  */
 
 struct displaced_step_closure *
 i386_displaced_step_copy_insn (struct gdbarch *gdbarch,
@@ -848,8 +847,7 @@ i386_displaced_step_fixup (struct gdbarch *gdbarch,
      applying it.  */
   ULONGEST insn_offset = to - from;
 
-  /* Since we use simple_displaced_step_copy_insn, our closure is a
-     copy of the instruction.  */
+  /* Our closure is a copy of the instruction.  */
   gdb_byte *insn = (gdb_byte *) closure;
   /* The start of the insn, needed in case we see some prefixes.  */
   gdb_byte *insn_start = insn;
index 92395adb1a293b30b55c4096aba95359cc03a4ba..df1a84d76ed6799faf48497d001041ba47c6d476 100644 (file)
@@ -1014,8 +1014,7 @@ typedef BP_MANIPULATION_ENDIAN (little_breakpoint, big_breakpoint)
                                         || (insn & STORE_CONDITIONAL_MASK) == STHCX_INSTRUCTION \
                                         || (insn & STORE_CONDITIONAL_MASK) == STQCX_INSTRUCTION)
 
-/* We can't displaced step atomic sequences.  Otherwise this is just
-   like simple_displaced_step_copy_insn.  */
+/* We can't displaced step atomic sequences.  */
 
 static struct displaced_step_closure *
 ppc_displaced_step_copy_insn (struct gdbarch *gdbarch,
This page took 0.037535 seconds and 4 git commands to generate.