diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-08-18 20:04:56 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-08-18 20:04:56 +0000 |
commit | 8b148df9ac8532b4a7cd0be2fdd011d29037e435 (patch) | |
tree | cf06b7ccca66764a7a1823a25600df7a756108c8 /gdb/x86-64-tdep.c | |
parent | 4091ea4e210e42c1d028e2a6143ff74d47e0aedf (diff) | |
download | gdb-8b148df9ac8532b4a7cd0be2fdd011d29037e435.zip gdb-8b148df9ac8532b4a7cd0be2fdd011d29037e435.tar.gz gdb-8b148df9ac8532b4a7cd0be2fdd011d29037e435.tar.bz2 |
Index: ChangeLog
2003-08-18 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (FRAME_RED_ZONE_SIZE): New architecture method.
* gdbarch.h, gdbarch.c: Re-generate.
* infcall.c (call_function_by_hand): Adjust the SP by
frame_red_zone_size before allocating any stack space.
* rs6000-tdep.c (rs6000_gdbarch_init): Set "frame_red_zone_size".
* x86-64-tdep.c (x86_64_frame_align): New function.
(x86_64_init_abi): Set "frame_red_zone_size" and "frame_align".
* x86-64-tdep.c (x86_64_push_arguments): Revert 2003-08-07 change.
Remove code adjusting SP so that it skips over the Red Zone.
Index: doc/ChangeLog
2003-08-18 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Document
"frame_red_zone_size".
Diffstat (limited to 'gdb/x86-64-tdep.c')
-rw-r--r-- | gdb/x86-64-tdep.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index 1edfc9e..78d06d3 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -614,13 +614,6 @@ x86_64_push_arguments (struct regcache *regcache, int nargs, int *stack_values; stack_values = alloca (nargs * sizeof (int)); - /* Before storing anything to the stack we must skip - the "Red zone" (see the "Function calling sequence" section - of AMD64 ABI). - It could have already been skipped in the function's - prologue, but we don't care and will easily skip it once again. */ - sp -= 128; - for (i = 0; i < nargs; i++) { enum x86_64_reg_class class[MAX_CLASSES]; @@ -1203,6 +1196,14 @@ x86_64_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) return frame_id_build (fp + 16, frame_pc_unwind (next_frame)); } +/* 16 byte align the SP per frame requirements. */ + +static CORE_ADDR +x86_64_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) +{ + return sp & -(CORE_ADDR)16; +} + void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -1246,6 +1247,8 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Call dummy code. */ set_gdbarch_push_dummy_call (gdbarch, x86_64_push_dummy_call); + set_gdbarch_frame_align (gdbarch, x86_64_frame_align); + set_gdbarch_frame_red_zone_size (gdbarch, 128); set_gdbarch_convert_register_p (gdbarch, x86_64_convert_register_p); set_gdbarch_register_to_value (gdbarch, i387_register_to_value); |