* gdb.texinfo: Fix typo, $bpnum is set to last breakpoint number.
[deliverable/binutils-gdb.git] / gdb / i386-tdep.c
index e2ebffa62a102486e80bcc2b79393ec6294a86fa..728d01296d1d2d208f14b781c23d286651486a7c 100644 (file)
@@ -29,6 +29,7 @@
 #include "symtab.h"
 #include "gdbcmd.h"
 #include "command.h"
+#include "arch-utils.h"
 
 static long i386_get_frame_setup (CORE_ADDR);
 
@@ -74,15 +75,15 @@ int i386_register_virtual_size[MAX_NUM_REGS];
 
 /* This is the variable the is set with "set disassembly-flavor",
    and its legitimate values. */
-static char att_flavor[] = "att";
-static char intel_flavor[] = "intel";
-static char *valid_flavors[] =
+static const char att_flavor[] = "att";
+static const char intel_flavor[] = "intel";
+static const char *valid_flavors[] =
 {
   att_flavor,
   intel_flavor,
   NULL
 };
-static char *disassembly_flavor = att_flavor;
+static const char *disassembly_flavor = att_flavor;
 
 static void i386_print_register (char *, int, int);
 
@@ -637,6 +638,26 @@ i386_push_dummy_frame ()
   write_register (SP_REGNUM, sp);
 }
 
+/* Insert the (relative) function address into the call sequence
+   stored at DYMMY.  */
+
+void
+i386_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
+                    value_ptr *args, struct type *type, int gcc_p)
+{
+  int from, to, delta, loc;
+
+  loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH);
+  from = loc + 5;
+  to = (int)(fun);
+  delta = to - from;
+
+  *((char *)(dummy) + 1) = (delta & 0xff);
+  *((char *)(dummy) + 2) = ((delta >> 8) & 0xff);
+  *((char *)(dummy) + 3) = ((delta >> 16) & 0xff);
+  *((char *)(dummy) + 4) = ((delta >> 24) & 0xff);
+}
+
 void
 i386_pop_frame ()
 {
This page took 0.023662 seconds and 4 git commands to generate.