* lib/gdb.exp (get_hexadecimal_valueof): New procedure.
[deliverable/binutils-gdb.git] / gdb / i386-dicos-tdep.c
index 5fdaaba0b28166d1acabe1e25a491a4670de41c1..56395fe5d00d90b7a11ac1666fbcd41436c6e742 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for DICOS running on i386's, for GDB.
 
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "inferior.h"
 
 static CORE_ADDR
-i386_dicos_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
+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)
 {
-  /* Having a call dummy on the stack requires a gdbarch_frame_align
-     method to align the breakpoint instruction in the stack.
-     Strictly speaking, we could just return SP pristine on x86.  But,
-     as long as we're providing a frame align method, might as well
-     align for efficiency.  */
-  return sp & -(CORE_ADDR)16;
+  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
@@ -42,11 +49,19 @@ i386_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   set_solib_ops (gdbarch, &solib_target_so_ops);
 
+  /* Every process, although has its own address space, sees the same
+     list of shared libraries.  */
+  set_gdbarch_has_global_solist (gdbarch, 1);
+
   /* There's no (standard definition of) entry point or a guaranteed
      text location we could find with a symbol where to place the call
      dummy, so we put it on the stack.  */
   set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
-  set_gdbarch_frame_align (gdbarch, i386_dicos_frame_align);
+  set_gdbarch_push_dummy_code (gdbarch, i386_dicos_push_dummy_code);
+
+  /* DICOS rewinds itself.  Need to override the i386 default which is
+     to decrement the PC.  */
+  set_gdbarch_decr_pc_after_break (gdbarch, 0);
 }
 
 /* Look in the elf symbol table of ABFD for a symbol named WANTED.
This page took 0.027233 seconds and 4 git commands to generate.