+2003-03-25 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED): Replace
+ EXTRA_STACK_ALIGNMENT_NEEDED. Default to 0 not 1.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * config/sparc/tm-sparc.h
+ (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED): Define.
+ * sparc-tdep.c (sparc_gdbarch_init): Set
+ deprecated_extra_stack_alignment_needed.
+ * config/pa/tm-hppa.h (EXTRA_STACK_ALIGNMENT_NEEDED): Delete.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Do not clear
+ extra_stack_alignment_needed.
+ * v850-tdep.c (v850_gdbarch_init): Ditto.
+ * hppa-tdep.c (hppa_gdbarch_init): Ditto.
+ * h8300-tdep.c (h8300_gdbarch_init): Ditto.
+ * d10v-tdep.c (d10v_gdbarch_init): Ditto.
+ * cris-tdep.c (cris_gdbarch_init): Ditto.
+ * m68k-tdep.c (m68k_gdbarch_init): Ditto.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
+
2003-03-25 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (DEPRECATED_STORE_STRUCT_RETURN): Replace
#define STACK_ALIGN(sp) hppa_stack_align (sp)
#endif
-#if !GDB_MULTI_ARCH
-#define EXTRA_STACK_ALIGNMENT_NEEDED 0
-#endif
-
/* Sequence of bytes for breakpoint instruction. */
#define BREAKPOINT {0x00, 0x01, 0x00, 0x04}
#define TM_PRINT_INSN_MACH bfd_mach_sparc
+#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED 1
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
- /* No extra stack alignment needed. Set to 1 by default. */
- set_gdbarch_extra_stack_alignment_needed (gdbarch, 0);
-
/* Helpful for backtracing and returning in a call dummy. */
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
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);
set_gdbarch_print_registers_info (gdbarch, d10v_print_registers_info);
gdbarch_frame_num_args_ftype *frame_num_args;
gdbarch_stack_align_ftype *stack_align;
gdbarch_frame_align_ftype *frame_align;
- int extra_stack_alignment_needed;
+ int deprecated_extra_stack_alignment_needed;
gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
current_gdbarch->frame_args_address = get_frame_base;
current_gdbarch->frame_locals_address = get_frame_base;
- current_gdbarch->extra_stack_alignment_needed = 1;
current_gdbarch->convert_from_func_ptr_addr = core_addr_identity;
current_gdbarch->addr_bits_remove = core_addr_identity;
current_gdbarch->smash_text_address = core_addr_identity;
fprintf_unfiltered (log, "\n\tframe_num_args");
/* Skip verify of stack_align, has predicate */
/* Skip verify of frame_align, has predicate */
- /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
+ /* Skip verify of deprecated_extra_stack_alignment_needed, invalid_p == 0 */
/* Skip verify of reg_struct_has_addr, has predicate */
/* Skip verify of save_dummy_frame_tos, has predicate */
/* Skip verify of unwind_dummy_id, has predicate */
(long) current_gdbarch->deprecated_extract_struct_value_address
/*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
#endif
+#ifdef DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED # %s\n",
+ XSTRING (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED = %d\n",
+ DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED);
+#endif
#ifdef DEPRECATED_FRAME_CHAIN_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
(long) current_gdbarch->extract_struct_value_address
/*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
#endif
-#ifdef EXTRA_STACK_ALIGNMENT_NEEDED
- fprintf_unfiltered (file,
- "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n",
- XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED));
- fprintf_unfiltered (file,
- "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %d\n",
- EXTRA_STACK_ALIGNMENT_NEEDED);
-#endif
#ifdef FIX_CALL_DUMMY
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
}
int
-gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
+gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
+ /* Skip verify of deprecated_extra_stack_alignment_needed, invalid_p == 0 */
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
- return gdbarch->extra_stack_alignment_needed;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extra_stack_alignment_needed called\n");
+ return gdbarch->deprecated_extra_stack_alignment_needed;
}
void
-set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
- int extra_stack_alignment_needed)
+set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch,
+ int deprecated_extra_stack_alignment_needed)
{
- gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed;
+ gdbarch->deprecated_extra_stack_alignment_needed = deprecated_extra_stack_alignment_needed;
}
int
extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address);
extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align);
+/* NOTE: cagney/2003-03-24: This is better handled by PUSH_ARGUMENTS. */
+
/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (EXTRA_STACK_ALIGNMENT_NEEDED)
-#define EXTRA_STACK_ALIGNMENT_NEEDED (1)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
+#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (0)
#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 > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRA_STACK_ALIGNMENT_NEEDED)
-#error "Non multi-arch definition of EXTRA_STACK_ALIGNMENT_NEEDED"
+extern int gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch, int deprecated_extra_stack_alignment_needed);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
+#error "Non multi-arch definition of DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED"
#endif
#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))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
+#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_deprecated_extra_stack_alignment_needed (current_gdbarch))
#endif
#endif
#
F:2:STACK_ALIGN:CORE_ADDR:stack_align:CORE_ADDR sp:sp::0:0
M:::CORE_ADDR:frame_align:CORE_ADDR address:address
-v:2:EXTRA_STACK_ALIGNMENT_NEEDED:int:extra_stack_alignment_needed::::0:1::0:::
+# NOTE: cagney/2003-03-24: This is better handled by PUSH_ARGUMENTS.
+v:2:DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED:int:deprecated_extra_stack_alignment_needed::::0:0::0:::
F:2:REG_STRUCT_HAS_ADDR:int:reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type::0:0
# FIXME: kettenis/2003-03-08: This should be replaced by a function
# parametrized with (at least) the regcache.
set_gdbarch_addr_bit (gdbarch, BINWORD * TARGET_CHAR_BIT);
/* set_gdbarch_stack_align (gdbarch, SOME_stack_align); */
- set_gdbarch_extra_stack_alignment_needed (gdbarch, 0);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
return gdbarch;
set_gdbarch_saved_pc_after_call (gdbarch, hppa_saved_pc_after_call);
set_gdbarch_inner_than (gdbarch, hppa_inner_than);
set_gdbarch_stack_align (gdbarch, hppa_stack_align);
- set_gdbarch_extra_stack_alignment_needed (gdbarch, 0);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_num_regs (gdbarch, hppa_num_regs);
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, m68hc11_breakpoint_from_pc);
set_gdbarch_stack_align (gdbarch, m68hc11_stack_align);
+ set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1);
set_gdbarch_print_insn (gdbarch, gdb_print_insn_m68hc11);
m68hc11_add_reggroups (gdbarch);
/* Stack grows down. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_stack_align (gdbarch, m68k_stack_align);
-
+ set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_decr_pc_after_break (gdbarch, 2);
set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
#endif
set_gdbarch_stack_align (gdbarch, sparc32_stack_align);
+ set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1);
set_gdbarch_deprecated_store_struct_return (gdbarch, sparc32_store_struct_return);
set_gdbarch_use_struct_convention (gdbarch,
generic_use_struct_convention);
set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
#endif
set_gdbarch_stack_align (gdbarch, sparc64_stack_align);
+ set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1);
set_gdbarch_deprecated_store_struct_return (gdbarch, sparc64_store_struct_return);
set_gdbarch_use_struct_convention (gdbarch,
sparc64_use_struct_convention);
set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
- set_gdbarch_extra_stack_alignment_needed (gdbarch, 0);
-
return gdbarch;
}
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)
+ /* NOTE: cagney/2003-03-24: The below code is very broken. Given an
+ odd sized parameter the below will mis-align the stack. As was
+ suggested back in '96, better to let PUSH_ARGUMENTS handle it. */
+ if (DEPRECATED_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
set_gdbarch_pointer_to_address (gdbarch, xstormy16_pointer_to_address);
set_gdbarch_stack_align (gdbarch, xstormy16_stack_align);
- set_gdbarch_extra_stack_alignment_needed (gdbarch, 0);
set_gdbarch_save_dummy_frame_tos (gdbarch, xstormy16_save_dummy_frame_tos);