/* Stack grows downward. */
-#define INNER_THAN <
+#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
/* Illegal instruction - used by the simulator for breakpoint
detection */
define this before including this file. */
#define DECR_PC_AFTER_BREAK 0
-/* Nonzero if instruction at PC is a return instruction. */
-#define ABOUT_TO_RETURN(pc) (read_memory_integer(pc,2) == 0x000b)
-
/* Say how long registers are. */
#define REGISTER_TYPE long
/* Initializer for an array of names of registers.
Entries beyond the first NUM_REGS are ignored. */
-#define REGISTER_NAMES \
- { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
- "pc", "pr", "gbr", "vbr", "mach", "macl", "sr", \
- "fpul", "fpscr", \
- "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", \
- "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15", \
- "ssr", "spc", \
- "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0", \
- "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1", \
- }
+extern char **sh_register_names;
+#define REGISTER_NAME(i) sh_register_names[i]
#define NUM_REGS 59
#define MACL_REGNUM 21
#define SR_REGNUM 22
#define FPUL_REGNUM 23
+#define FPSCR_REGNUM 24
#define FP0_REGNUM 25
#define FP15_REGNUM 40
#define SSR_REGNUM 41
#define STORE_STRUCT_RETURN(ADDR, SP) \
{ write_register (STRUCT_RETURN_REGNUM, (ADDR)); }
-#define USE_STRUCT_CONVENTION(gcc_p, type) (TYPE_LENGTH(type) > 1)
+extern use_struct_convention_fn sh_use_struct_convention;
+#define USE_STRUCT_CONVENTION(gcc_p, type) sh_use_struct_convention (gcc_p, type)
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
sh_init_extra_frame_info(fromleaf, fi)
+extern void sh_init_extra_frame_info PARAMS ((int, struct frame_info *));
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
unsigned char struct_return,
CORE_ADDR struct_addr));
+#define USE_GENERIC_DUMMY_FRAMES
#define CALL_DUMMY {0}
#define CALL_DUMMY_LENGTH (0)
#define CALL_DUMMY_START_OFFSET (0)
#define PUSH_RETURN_ADDRESS(PC, SP) sh_push_return_address (PC, SP)
+extern CORE_ADDR sh_frame_chain PARAMS ((struct frame_info *));
#define FRAME_CHAIN(FRAME) sh_frame_chain(FRAME)
#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
#define FRAME_CHAIN_VALID(FP, FRAME) generic_frame_chain_valid (FP, FRAME)
/* Discard from the stack the innermost frame, restoring all saved
registers. */
+extern void sh_pop_frame PARAMS ((void));
#define POP_FRAME sh_pop_frame();
#define NOP {0x20, 0x0b}
#define REGISTER_SIZE 4
#define COERCE_FLOAT_TO_DOUBLE 1
+
+#define BELIEVE_PCC_PROMOTION 1
+
+/* Need this for WinGDB. See gdb/mswin/{regdoc.h, gdbwin.c, gui.cpp}. */
+#define TARGET_SH