2011-04-07 Yao Qi <yao@codesourcery.com>
authorYao Qi <yao@codesourcery.com>
Thu, 7 Apr 2011 04:18:02 +0000 (04:18 +0000)
committerYao Qi <yao@codesourcery.com>
Thu, 7 Apr 2011 04:18:02 +0000 (04:18 +0000)
* arm-linux-tdep.c (arm_linux_copy_svc): Remove parameters INSN
and TO.
* arm-tdep.c (cleanup_svc): Handle variable instruction size.
(arm_copy_svc): Remove parameters INSN and TO.
(decode_svc_copro): Update caller.
* arm-tdep.h (struct displaced_step_closure): Remove parameters
from function pointer `copy_svc_os'.

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

index 42b8b93f241695d1e17ba9537832993f6af0b742..f6050a95ad1e4f45edb59291ae96e5627768a3c4 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-07  Yao Qi  <yao@codesourcery.com>
+
+       * arm-linux-tdep.c (arm_linux_copy_svc): Remove parameters INSN
+       and TO.
+       * arm-tdep.c (cleanup_svc): Handle variable instruction size.
+       (arm_copy_svc): Remove parameters INSN and TO.
+       (decode_svc_copro): Update caller.
+       * arm-tdep.h (struct displaced_step_closure): Remove parameters
+       from function pointer `copy_svc_os'.
+
 2011-04-07  Yao Qi  <yao@codesourcery.com>
 
        * arm-tdep.c (cleanup_branch): Set a correct return address in
index 9db125eecfb729c0036cf99fb6402a8c249f1048..b7ff5ecdb4629207199a99e6cc83d866d40d51c2 100644 (file)
@@ -795,8 +795,8 @@ arm_linux_cleanup_svc (struct gdbarch *gdbarch,
 }
 
 static int
-arm_linux_copy_svc (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to,
-                   struct regcache *regs, struct displaced_step_closure *dsc)
+arm_linux_copy_svc (struct gdbarch *gdbarch, struct regcache *regs,
+                   struct displaced_step_closure *dsc)
 {
   CORE_ADDR return_to = 0;
 
@@ -805,10 +805,6 @@ arm_linux_copy_svc (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to,
   int is_sigreturn = 0;
   int is_thumb;
 
-  if (debug_displaced)
-    fprintf_unfiltered (gdb_stdlog, "displaced: copying Linux svc insn %.8lx\n",
-                       (unsigned long) insn);
-
   frame = get_current_frame ();
 
   is_sigreturn = arm_linux_sigreturn_return_addr(frame, svc_number,
@@ -862,7 +858,6 @@ arm_linux_copy_svc (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to,
      Cleanup: if pc lands in scratch space, pc <- insn_addr + 4
               else leave pc alone.  */
 
-  dsc->modinsn[0] = insn;
 
   dsc->cleanup = &arm_linux_cleanup_svc;
   /* Pretend we wrote to the PC, so cleanup doesn't set PC to the next
index 024191b9b3bd9422b488749645e73f65d8eda0d8..f33dc10cc4a436abdef6eac65089dc675adecebd 100644 (file)
@@ -6358,7 +6358,7 @@ static void
 cleanup_svc (struct gdbarch *gdbarch, struct regcache *regs,
             struct displaced_step_closure *dsc)
 {
-  CORE_ADDR resume_addr = dsc->insn_addr + 4;
+  CORE_ADDR resume_addr = dsc->insn_addr + dsc->insn_size;
 
   if (debug_displaced)
     fprintf_unfiltered (gdb_stdlog, "displaced: cleanup for svc, resume at "
@@ -6368,12 +6368,9 @@ cleanup_svc (struct gdbarch *gdbarch, struct regcache *regs,
 }
 
 static int
-copy_svc (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to,
+copy_svc (struct gdbarch *gdbarch, uint32_t insn,
          struct regcache *regs, struct displaced_step_closure *dsc)
 {
-  /* Allow OS-specific code to override SVC handling.  */
-  if (dsc->u.svc.copy_svc_os)
-    return dsc->u.svc.copy_svc_os (gdbarch, insn, to, regs, dsc);
 
   if (debug_displaced)
     fprintf_unfiltered (gdb_stdlog, "displaced: copying svc insn %.8lx\n",
@@ -6385,12 +6382,19 @@ copy_svc (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to,
 
   dsc->modinsn[0] = insn;
 
-  dsc->cleanup = &cleanup_svc;
   /* Pretend we wrote to the PC, so cleanup doesn't set PC to the next
      instruction.  */
   dsc->wrote_to_pc = 1;
 
-  return 0;
+  /* Allow OS-specific code to override SVC handling.  */
+  if (dsc->u.svc.copy_svc_os)
+    return dsc->u.svc.copy_svc_os (gdbarch, regs, dsc);
+  else
+    {
+      dsc->cleanup = &cleanup_svc;
+      return 0;
+    }
+
 }
 
 /* Copy undefined instructions.  */
@@ -6843,7 +6847,7 @@ decode_svc_copro (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to,
   else if ((op1 & 0x31) == 0x21 && op && (coproc & 0xe) != 0xa)
     return copy_unmodified (gdbarch, insn, "mrc/mrc2", dsc);
   else if ((op1 & 0x30) == 0x30)
-    return copy_svc (gdbarch, insn, to, regs, dsc);
+    return copy_svc (gdbarch, insn, regs, dsc);
   else
     return copy_undef (gdbarch, insn, dsc);  /* Possibly unreachable.  */
 }
index f0473517a1840d25ca30ae46950f73e6c4f9917b..fe27c7f1087c5ddf3d2d034545f2b5ad55ee8664 100644 (file)
@@ -258,8 +258,7 @@ struct displaced_step_closure
     {
       /* If non-NULL, override generic SVC handling (e.g. for a particular
          OS).  */
-      int (*copy_svc_os) (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to,
-                         struct regcache *regs,
+      int (*copy_svc_os) (struct gdbarch *gdbarch, struct regcache *regs,
                          struct displaced_step_closure *dsc);
     } svc;
   } u;
This page took 0.033666 seconds and 4 git commands to generate.