gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 18 Jun 2012 17:31:34 +0000 (17:31 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 18 Jun 2012 17:31:34 +0000 (17:31 +0000)
Switch i386 and derived targets to ON_STACK.
* amd64-dicos-tdep.c (amd64_dicos_push_dummy_code): Remove.
(amd64_dicos_init_abi): Remove its installment.
* dicos-tdep.c (dicos_init_abi): Remove the
set_gdbarch_call_dummy_location call.  Update the comment here.
* i386-dicos-tdep.c (i386_dicos_push_dummy_code): Remove.
(i386_dicos_init_abi): Remove its installment.
* i386-tdep.c (i386_push_dummy_code): New function.
(i386_gdbarch_init): Call set_gdbarch_call_dummy_location, install
i386_push_dummy_code.

gdb/ChangeLog
gdb/amd64-dicos-tdep.c
gdb/dicos-tdep.c
gdb/i386-dicos-tdep.c
gdb/i386-tdep.c

index ee6dfc3c961492d8dd82b959c99a285e4eb81de3..6c1019a85e5833662b5fc271369202bc5e9b8f6c 100644 (file)
@@ -1,3 +1,17 @@
+2012-06-18  Mark Kettenis  <kettenis@gnu.org>
+           Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Switch i386 and derived targets to ON_STACK.
+       * amd64-dicos-tdep.c (amd64_dicos_push_dummy_code): Remove.
+       (amd64_dicos_init_abi): Remove its installment.
+       * dicos-tdep.c (dicos_init_abi): Remove the
+       set_gdbarch_call_dummy_location call.  Update the comment here.
+       * i386-dicos-tdep.c (i386_dicos_push_dummy_code): Remove.
+       (i386_dicos_init_abi): Remove its installment.
+       * i386-tdep.c (i386_push_dummy_code): New function.
+       (i386_gdbarch_init): Call set_gdbarch_call_dummy_location, install
+       i386_push_dummy_code.
+
 2012-06-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Remove stale dummy frames.
index a262284f6a2e7a15b8ec773e72b94fe339039607..a983bb2bf87ea642b49d9620f3b230b4b9bb74e6 100644 (file)
 #include "amd64-tdep.h"
 #include "dicos-tdep.h"
 
-static CORE_ADDR
-amd64_dicos_push_dummy_code (struct gdbarch *gdbarch,
-                            CORE_ADDR sp, CORE_ADDR funaddr,
-                            struct value **args, int nargs,
-                            struct type *value_type,
-                            CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
-                            struct regcache *regcache)
-{
-  int bplen;
-  CORE_ADDR bppc = sp;
-
-  gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
-  *bp_addr = sp - bplen;
-  *real_pc = funaddr;
-
-  return *bp_addr;
-}
-
 static void
 amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -49,8 +31,6 @@ amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   amd64_init_abi (info, gdbarch);
 
   dicos_init_abi (gdbarch);
-
-  set_gdbarch_push_dummy_code (gdbarch, amd64_dicos_push_dummy_code);
 }
 
 static enum gdb_osabi
index 57635616077319960d4c6edf6eb37bbb13cb840d..aac253b30d838b72cc42d70ad9e15920887434e0 100644 (file)
@@ -43,8 +43,8 @@ dicos_init_abi (struct gdbarch *gdbarch)
 
   /* There's no (standard definition of) entry point or a guaranteed
      text location with a symbol where to place the call dummy, so we
-     put it on the stack.  */
-  set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+     need it on the stack.  Rely on i386_gdbarch_init used also for
+     amd64 to set up ON_STACK inferior calls.  */
 
   /* DICOS rewinds the PC itself.  */
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
index 8039c90fb2308937ce48531f344f1d74d2ecf4ed..ca37673a6d55111ecd10c1d3d0062d9c223bf997 100644 (file)
 #include "gdb_string.h"
 #include "dicos-tdep.h"
 
-static CORE_ADDR
-i386_dicos_push_dummy_code (struct gdbarch *gdbarch,
-                           CORE_ADDR sp, CORE_ADDR funaddr,
-                           struct value **args, int nargs,
-                           struct type *value_type,
-                           CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
-                           struct regcache *regcache)
-{
-  int bplen;
-  CORE_ADDR bppc = sp;
-
-  gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
-  *bp_addr = sp - bplen;
-  *real_pc = funaddr;
-
-  return *bp_addr;
-}
-
 static void
 i386_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   dicos_init_abi (gdbarch);
-
-  set_gdbarch_push_dummy_code (gdbarch, i386_dicos_push_dummy_code);
 }
 
 static enum gdb_osabi
index ce4c8a4cac24be2db710a6b29f68e8ebf95a9115..fd5969d61e0a6ff57184300e6f85082d75d27d0a 100644 (file)
@@ -2332,6 +2332,22 @@ i386_16_byte_align_p (struct type *type)
   return 0;
 }
 
+/* Implementation for set_gdbarch_push_dummy_code.  */
+
+static CORE_ADDR
+i386_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr,
+                     struct value **args, int nargs, struct type *value_type,
+                     CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
+                     struct regcache *regcache)
+{
+  /* Use 0xcc breakpoint - 1 byte.  */
+  *bp_addr = sp - 1;
+  *real_pc = funaddr;
+
+  /* Keep the stack aligned.  */
+  return sp - 16;
+}
+
 static CORE_ADDR
 i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                      struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
@@ -7705,6 +7721,8 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target);
 
   /* Call dummy code.  */
+  set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+  set_gdbarch_push_dummy_code (gdbarch, i386_push_dummy_code);
   set_gdbarch_push_dummy_call (gdbarch, i386_push_dummy_call);
   set_gdbarch_frame_align (gdbarch, i386_frame_align);
 
This page took 0.031056 seconds and 4 git commands to generate.