aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-08-04 03:17:57 +0000
committerAndrew Cagney <cagney@redhat.com>2000-08-04 03:17:57 +0000
commit0a49d05ee07086ae07448a203fc8e89ea0af89d1 (patch)
tree501dba85b2506732136312e0a21da989f54880f2 /gdb
parentf6e6b40ff59365e1c8698764eea9fd1818bdb02a (diff)
downloadgdb-0a49d05ee07086ae07448a203fc8e89ea0af89d1.zip
gdb-0a49d05ee07086ae07448a203fc8e89ea0af89d1.tar.gz
gdb-0a49d05ee07086ae07448a203fc8e89ea0af89d1.tar.bz2
Multi-arch EXTRA_STACK_ALIGNMENT_NEEDED (nee NO_EXTRA_ALIGNMENT_NEEDED).
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog13
-rw-r--r--gdb/config/pa/tm-hppa.h2
-rw-r--r--gdb/d10v-tdep.c1
-rw-r--r--gdb/gdbarch.h13
-rwxr-xr-xgdb/gdbarch.sh1
-rw-r--r--gdb/valops.c40
6 files changed, 49 insertions, 21 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 866bc29..1629218 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,16 @@
+Wed Aug 2 21:15:26 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbarch.sh (EXTRA_STACK_ALIGNMENT_NEEDED): Add.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * valops.c (hand_function_call): Replace #ifndef
+ NO_EXTRA_ALIGNMENT_NEEDED with if EXTRA_STACK_ALIGNMENT_NEEDED.
+
+ * d10v-tdep.c (d10v_gdbarch_init): Set
+ extra_stack_alignment_needed to 0.
+ * config/d10v/tm-d10v.h (NO_EXTRA_ALIGNMENT_NEEDED): Delete.
+ * config/pa/tm-hppa.h (EXTRA_STACK_ALIGNMENT_NEEDED): Replace
+ NO_EXTRA_ALIGNMENT_NEEDED.
+
2000-08-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* MAINTAINERS (m68hc11): Stephane Carrez is maintainer.
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index 2dbb74b..269e30f 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -106,7 +106,7 @@ extern CORE_ADDR saved_pc_after_call (struct frame_info *);
On hppa the sp must always be kept 64-bit aligned */
#define STACK_ALIGN(arg) ( ((arg)%8) ? (((arg)+7)&-8) : (arg))
-#define NO_EXTRA_ALIGNMENT_NEEDED 1
+#define EXTRA_STACK_ALIGNMENT_NEEDED 0
/* Sequence of bytes for breakpoint instruction. */
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index c5b7b5a..ed71bfc 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -1603,6 +1603,7 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_stack_align (gdbarch, d10v_stack_align);
set_gdbarch_register_sim_regno (gdbarch, d10v_register_sim_regno);
+ set_gdbarch_extra_stack_alignment_needed (gdbarch, 0);
return gdbarch;
}
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 64b0368..7f713c7 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1114,6 +1114,19 @@ extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_alig
#endif
#endif
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRA_STACK_ALIGNMENT_NEEDED)
+#define EXTRA_STACK_ALIGNMENT_NEEDED (1)
+#endif
+
+extern int gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch);
+extern void set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, int extra_stack_alignment_needed);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRA_STACK_ALIGNMENT_NEEDED)
+#define EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_extra_stack_alignment_needed (current_gdbarch))
+#endif
+#endif
+
#if defined (REG_STRUCT_HAS_ADDR)
/* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */
#define REG_STRUCT_HAS_ADDR_P() (1)
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index a64d340..0c9bdfb 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -426,6 +426,7 @@ f:2:SAVED_PC_AFTER_CALL:CORE_ADDR:saved_pc_after_call:struct frame_info *frame:f
f:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame::0:0
#
F:2:STACK_ALIGN:CORE_ADDR:stack_align:CORE_ADDR sp:sp::0:0
+v:1:EXTRA_STACK_ALIGNMENT_NEEDED:int:extra_stack_alignment_needed::::0:1::0:::
F:2:REG_STRUCT_HAS_ADDR:int:reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type::0:0
F:2:SAVE_DUMMY_FRAME_TOS:void:save_dummy_frame_tos:CORE_ADDR sp:sp::0:0
#
diff --git a/gdb/valops.c b/gdb/valops.c
index df1e9ee..19482f1 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1581,27 +1581,27 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
}
}
-/* elz: on HPPA no need for this extra alignment, maybe it is needed
- on other architectures. This is because all the alignment is taken care
- of in the above code (ifdef REG_STRUCT_HAS_ADDR) and in
- hppa_push_arguments */
-#ifndef NO_EXTRA_ALIGNMENT_NEEDED
-
- /* MVS 11/22/96: I think at least some of this stack_align code is
- really broken. Better to let PUSH_ARGUMENTS adjust the stack in
- a target-defined manner. */
- if (STACK_ALIGN_P () && INNER_THAN (1, 2))
- {
- /* If stack grows down, we must leave a hole at the top. */
- int len = 0;
-
- for (i = nargs - 1; i >= 0; i--)
- len += TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i]));
- if (CALL_DUMMY_STACK_ADJUST_P)
- len += CALL_DUMMY_STACK_ADJUST;
- sp -= STACK_ALIGN (len) - len;
+ /* elz: on HPPA no need for this extra alignment, maybe it is needed
+ on other architectures. This is because all the alignment is
+ taken care of in the above code (ifdef REG_STRUCT_HAS_ADDR) and
+ in hppa_push_arguments */
+ if (EXTRA_STACK_ALIGNMENT_NEEDED)
+ {
+ /* MVS 11/22/96: I think at least some of this stack_align code
+ is really broken. Better to let PUSH_ARGUMENTS adjust the
+ stack in a target-defined manner. */
+ if (STACK_ALIGN_P () && INNER_THAN (1, 2))
+ {
+ /* If stack grows down, we must leave a hole at the top. */
+ int len = 0;
+
+ for (i = nargs - 1; i >= 0; i--)
+ len += TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i]));
+ if (CALL_DUMMY_STACK_ADJUST_P)
+ len += CALL_DUMMY_STACK_ADJUST;
+ sp -= STACK_ALIGN (len) - len;
+ }
}
-#endif /* NO_EXTRA_ALIGNMENT_NEEDED */
sp = PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr);