summaryrefslogtreecommitdiff
path: root/gdb/m88k-tdep.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-11-14 22:15:41 +0000
committerJohn Gilmore <gnu@cygnus>1991-11-14 22:15:41 +0000
commit653d6c56a180771bd5024b45c3ad24d642ea0894 (patch)
treeca09fc47b21bbb18750ef2d8e2be9689ed43256a /gdb/m88k-tdep.c
parentfaa0da67eff84eca1418bb06bae605d62b753c5f (diff)
downloadbinutils-gdb-653d6c56a180771bd5024b45c3ad24d642ea0894.tar.gz
Handle moves ahead of the stack pointer slide, for struct returning fns.
Diffstat (limited to 'gdb/m88k-tdep.c')
-rw-r--r--gdb/m88k-tdep.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c
index 65e39f6b0a8..ff15ff847c6 100644
--- a/gdb/m88k-tdep.c
+++ b/gdb/m88k-tdep.c
@@ -251,6 +251,32 @@ examine_prologue (ip, limit, frame_sp, fsr, fi)
bzero (must_adjust, sizeof (must_adjust));
next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
+ /* Accept move of incoming registers to other registers, using
+ "or rd,rs,0" or "or.u rd,rs,0" or "or rd,r0,rs" or "or rd,rs,r0".
+ We don't have to worry about walking into the first lines of code,
+ since the first line number will stop us (assuming we have symbols).
+ What we have actually seen is "or r10,r0,r12". */
+
+#define OR_MOVE_INSN 0x58000000 /* or/or.u with immed of 0 */
+#define OR_MOVE_MASK 0xF800FFFF
+#define OR_REG_MOVE1_INSN 0xF4005800 /* or rd,r0,rs */
+#define OR_REG_MOVE1_MASK 0xFC1FFFE0
+#define OR_REG_MOVE2_INSN 0xF4005800 /* or rd,rs,r0 */
+#define OR_REG_MOVE2_MASK 0xFC00FFFF
+ while (next_ip &&
+ ((insn1 & OR_MOVE_MASK) == OR_MOVE_INSN ||
+ (insn1 & OR_REG_MOVE1_MASK) == OR_REG_MOVE1_INSN ||
+ (insn1 & OR_REG_MOVE2_MASK) == OR_REG_MOVE2_INSN
+ )
+ )
+ {
+ /* We don't care what moves to where. The result of the moves
+ has already been reflected in what the compiler tells us is the
+ location of these parameters. */
+ ip = next_ip;
+ next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
+ }
+
/* Accept an optional "subu sp,sp,n" to set up the stack pointer. */
#define SUBU_SP_INSN 0x67ff0000