This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[PATCH] Fix d10v inferior function call stack alignment
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [PATCH] Fix d10v inferior function call stack alignment
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 09 Feb 2000 15:49:47 +1100
- Organization: Cygnus Solutions
Just FYI,
The below tweeks the d10v configury so that GDB keeps SP correctly
aligned when performing an inferior function call. I've committed the
change.
Andrew
Wed Feb 9 01:14:54 2000 Andrew Cagney <cagney@amy.cygnus.com>
* config/d10v/tm-d10v.h (NO_EXTRA_ALIGNMENT_NEEDED): Define.
* config/d10v/tm-d10v.h (STACK_ALIGN): Define.
(d10v_stack_align): Declare.
* d10v-tdep.c (d10v_stack_align): Define.
Index: d10v-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/d10v-tdep.c,v
retrieving revision 2.57.2.5
diff -p -r2.57.2.5 d10v-tdep.c
*** d10v-tdep.c 1999/10/27 14:30:15 2.57.2.5
--- d10v-tdep.c 2000/02/08 14:27:50
*************** d10v_frame_chain_valid (chain, frame)
*** 104,109 ****
--- 104,114 ----
return ((chain) != 0 && (frame) != 0 && (frame)->pc > IMEM_START);
}
+ CORE_ADDR
+ d10v_stack_align (CORE_ADDR len)
+ {
+ return (len + 1) & ~1;
+ }
/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
Index: config/d10v/tm-d10v.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/config/d10v/tm-d10v.h,v
retrieving revision 1.67.24.2
diff -p -r1.67.24.2 tm-d10v.h
*** tm-d10v.h 1999/10/23 13:43:31 1.67.24.2
--- tm-d10v.h 2000/02/08 14:27:55
***************
*** 24,26 ****
--- 24,31 ----
extern int d10v_register_sim_regno (int reg);
#define REGISTER_SIM_REGNO(NR) d10v_register_sim_regno((NR))
+
+ extern CORE_ADDR d10v_stack_align (CORE_ADDR size);
+ #define STACK_ALIGN(SIZE) (d10v_stack_align (SIZE))
+
+ #define NO_EXTRA_ALIGNMENT_NEEDED 1