This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Milti-arch i386 call dummy bits
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 16 Jun 2002 00:13:09 +0200 (CEST)
- Subject: [PATCH] Milti-arch i386 call dummy bits
And there's more...
Committed.
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* config/i386/tm-i386.h (PARM_BOUNDARY, CALL_DUMMY,
CALL_DUMMY_LENGTH, CALL_DUMMY_START_OFFSET,
CALL_DUMMY_BREAKPOINT_OFFSET, FIX_CALL_DUMMY): Remove defines.
(i386_fix_call_dummy): Remove prototype.
* i386-tdep.c (i386_call_dummy_words): New variable.
(i386_gdbarch_init): Adjust for removal of the
macros mentioned above.
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.63
diff -u -p -r1.63 i386-tdep.c
--- i386-tdep.c 15 Jun 2002 21:15:41 -0000 1.63
+++ i386-tdep.c 15 Jun 2002 22:07:51 -0000
@@ -787,6 +787,19 @@ i386_push_dummy_frame (void)
write_register (FP_REGNUM, fp);
}
+/* The i386 call dummy sequence:
+
+ call 11223344 (32-bit relative)
+ int 3
+
+ It is 8 bytes long. */
+
+static LONGEST i386_call_dummy_words[] =
+{
+ 0x223344e8,
+ 0xcc11
+};
+
/* Insert the (relative) function address into the call sequence
stored at DYMMY. */
@@ -1407,15 +1420,26 @@ i386_gdbarch_init (struct gdbarch_info i
/* Call dummy code. */
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 0);
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 5);
set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
+ set_gdbarch_call_dummy_length (gdbarch, 8);
set_gdbarch_call_dummy_p (gdbarch, 1);
+ set_gdbarch_call_dummy_words (gdbarch, i386_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch,
+ sizeof (i386_call_dummy_words));
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
+ set_gdbarch_fix_call_dummy (gdbarch, i386_fix_call_dummy);
set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
set_gdbarch_push_arguments (gdbarch, i386_push_arguments);
set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack);
+
+ /* "An argument's size is increased, if necessary, to make it a
+ multiple of [32-bit] words. This may require tail padding,
+ depending on the size of the argument" -- from the x86 ABI. */
+ set_gdbarch_parm_boundary (gdbarch, 32);
set_gdbarch_deprecated_extract_return_value (gdbarch,
i386_extract_return_value);
Index: config/i386/tm-i386.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-i386.h,v
retrieving revision 1.39
diff -u -p -r1.39 tm-i386.h
--- config/i386/tm-i386.h 15 Jun 2002 21:15:43 -0000 1.39
+++ config/i386/tm-i386.h 15 Jun 2002 22:07:51 -0000
@@ -65,36 +65,6 @@ extern void i387_float_info (void);
#define FLOAT_INFO { i387_float_info (); }
-/* Things needed for making the inferior call functions. */
-
-/* "An argument's size is increased, if necessary, to make it a
- multiple of [32 bit] words. This may require tail padding,
- depending on the size of the argument" - from the x86 ABI. */
-#define PARM_BOUNDARY 32
-
-
-/* this is
- * call 11223344 (32 bit relative)
- * int3
- */
-
-#define CALL_DUMMY { 0x223344e8, 0xcc11 }
-
-#define CALL_DUMMY_LENGTH 8
-
-#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
-
-#define CALL_DUMMY_BREAKPOINT_OFFSET 5
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
- i386_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p)
-extern void i386_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
- int nargs, struct value **args,
- struct type *type, int gcc_p);
-
/* FIXME: kettenis/2000-06-12: These do not belong here. */
extern void print_387_control_word (unsigned int);
extern void print_387_status_word (unsigned int);