aboutsummaryrefslogtreecommitdiff
path: root/gdb/tm-29k.h
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1992-08-11 09:54:24 +0000
committerJohn Gilmore <gnu@cygnus>1992-08-11 09:54:24 +0000
commit6872cfda60efd427da90039b51a1dada52280cc9 (patch)
tree66a52b870e72d5a52ec850bb442a8b8b08cf5afe /gdb/tm-29k.h
parenta679650f372dfeb7358266ab7cc56e1f7df489eb (diff)
downloadgdb-6872cfda60efd427da90039b51a1dada52280cc9.zip
gdb-6872cfda60efd427da90039b51a1dada52280cc9.tar.gz
gdb-6872cfda60efd427da90039b51a1dada52280cc9.tar.bz2
Changes to make MIPS x 29K compile.
* am29k-tdep.c: Lint from DECstation compiler. * mem-break.c: Restore test of BREAKPOINT size that Fred removed. As the man page says, "Sometimes you just can't get lint to shut up". That doesn't mean you should blow away the code it won't shut up about. * mips-xdep.c: Revise stubbing-out of code until Rich cleans it up over the next few weeks. Make mips x 29k build. * tm-29k.h (CALL_DUMMY): Make it work on cross-endian hosts. (FIX_CALL_DUMMY): Comment in the patching of the breakpoint, but leave it as a comment because the breakpoint instruction is not easily accessible at this moment (it's static, and if we define one here, it goes into every file compiled).
Diffstat (limited to 'gdb/tm-29k.h')
-rw-r--r--gdb/tm-29k.h47
1 files changed, 30 insertions, 17 deletions
diff --git a/gdb/tm-29k.h b/gdb/tm-29k.h
index c1c30ca..5173637 100644
--- a/gdb/tm-29k.h
+++ b/gdb/tm-29k.h
@@ -620,24 +620,36 @@ extern void pop_frame ();
mtsrim cr, 15
loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers
add msp, msp, 16 * 4 ; point to the remaining arguments
- CONST_INSN:
- const lr0,inf
- consth lr0,inf
+ CONST_INSN:
+ const lr0,inf ; (replaced by half of target addr)
+ consth lr0,inf ; (replaced by other half of target addr)
calli lr0, lr0
aseq 0x40,gr1,gr1 ; nop
- asneq 0x50,gr1,gr1 ; breakpoint
+ BREAKPT_INSN:
+ asneq 0x50,gr1,gr1 ; breakpoint (replaced by local breakpoint insn)
*/
-/* Position of the "const" instruction within CALL_DUMMY in bytes. */
-#define CONST_INSN (3 * 4)
#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
-#define CALL_DUMMY {0x0400870f,\
- 0x36008200|(MSP_HW_REGNUM), \
- 0x15000040|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16), \
- 0x03ff80ff, 0x02ff80ff, 0xc8008080, 0x70400101, 0x72500101}
-#else /* Byte order differs. */
- you lose
-#endif /* Byte order differs. */
+#define BS(const) const
+#else
+#define BS(const) (((const) & 0xff) << 24) | \
+ (((const) & 0xff00) << 8) | \
+ (((const) & 0xff0000) >> 8) | \
+ (((const) & 0xff000000) >> 24)
+#endif
+
+/* Position of the "const" and blkt instructions within CALL_DUMMY in bytes. */
+#define CONST_INSN (3 * 4)
+#define BREAKPT_INSN (7 * 4)
+#define CALL_DUMMY { \
+ BS(0x0400870f),\
+ BS(0x36008200|(MSP_HW_REGNUM)), \
+ BS(0x15000040|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16)), \
+ BS(0x03ff80ff), \
+ BS(0x02ff80ff), \
+ BS(0xc8008080), \
+ BS(0x70400101), \
+ BS(0x72500101)}
#define CALL_DUMMY_LENGTH (8 * 4)
#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
@@ -664,14 +676,15 @@ extern void pop_frame ();
into a call sequence of the above form stored at DUMMYNAME. */
/* Currently this stuffs in the address of the function that we are calling.
- If different 29k systems use different breakpoint instructions, it
- could also stuff BREAKPOINT in the right place (to avoid having to
+ Since different 29k systems use different breakpoint instructions, it
+ also stuffs BREAKPOINT in the right place (to avoid having to
duplicate CALL_DUMMY in each tm-*.h file). */
#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
{\
- STUFF_I16((char *)dummyname + CONST_INSN, fun);\
- STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16);\
+ STUFF_I16((char *)dummyname + CONST_INSN, fun); \
+ STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16); \
+ /* FIXME memcpy ((char *)(dummyname) + BREAKPT_INSN, break_insn, 4); */ \
}
/* 29k architecture has separate data & instruction memories -- wired to