/* Generic 68000 stuff, to be included by other tm-*.h files. */
+struct frame_info;
+
+/* Sequence of bytes for breakpoint instruction.
+ This is a TRAP instruction. The last 4 bits (0xf below) is the
+ vector. Systems which don't use 0xf should define BPT_VECTOR
+ themselves before including this file. */
+
+#if !defined (BPT_VECTOR)
+#define BPT_VECTOR 0xf
+#endif
+
+#if !defined (BREAKPOINT)
+#define BREAKPOINT {0x4e, (0x40 | BPT_VECTOR)}
+#endif
+
+/* We default to vector 1 for the "remote" target, but allow targets
+ to override. */
+#if !defined (REMOTE_BPT_VECTOR)
+#define REMOTE_BPT_VECTOR 1
+#endif
+
+#if !defined (REMOTE_BREAKPOINT)
+#define REMOTE_BREAKPOINT {0x4e, (0x40 | REMOTE_BPT_VECTOR)}
+#endif
+
+#define REGISTER_BYTES_FP (16*4 + 8 + 8*12 + 3*4)
+#define REGISTER_BYTES_NOFP (16*4 + 8)
+
+
+#define NUM_FREGS (NUM_REGS-24)
+
+/* This was determined by experimentation on hp300 BSD 4.3. Perhaps
+ it corresponds to some offset in /usr/include/sys/user.h or
+ something like that. Using some system include file would
+ have the advantage of probably being more robust in the face
+ of OS upgrades, but the disadvantage of being wrong for
+ cross-debugging. */
+
+#define SIG_PC_FP_OFFSET 530
+
+/* Offset from SP to first arg on stack at first instruction of a function */
+
+#define SP_ARG0 (1 * 4)
+
+#define TARGET_M68K
+
+
#if !GDB_MULTI_ARCH
#define TARGET_LONG_DOUBLE_FORMAT &floatformat_m68881_ext
the new frame is not set up until the new function executes
some instructions. */
-struct frame_info;
-
#if !GDB_MULTI_ARCH
extern CORE_ADDR m68k_saved_pc_after_call (struct frame_info *);
#define STACK_ALIGN(ADDR) (((ADDR) + 1) & ~1)
#endif
-/* Sequence of bytes for breakpoint instruction.
- This is a TRAP instruction. The last 4 bits (0xf below) is the
- vector. Systems which don't use 0xf should define BPT_VECTOR
- themselves before including this file. */
-
-#if !defined (BPT_VECTOR)
-#define BPT_VECTOR 0xf
-#endif
-
-#if !defined (BREAKPOINT)
-#define BREAKPOINT {0x4e, (0x40 | BPT_VECTOR)}
-#endif
-
-/* We default to vector 1 for the "remote" target, but allow targets
- to override. */
-#if !defined (REMOTE_BPT_VECTOR)
-#define REMOTE_BPT_VECTOR 1
-#endif
-
-#if !defined (REMOTE_BREAKPOINT)
-#define REMOTE_BREAKPOINT {0x4e, (0x40 | REMOTE_BPT_VECTOR)}
-#endif
-
/* If your kernel resets the pc after the trap happens you may need to
define this before including this file. */
#endif
#endif
+#if !GDB_MULTI_ARCH
+#ifndef NUM_REGS
+#define NUM_REGS 29
+#endif
+#endif
+
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
#define REGISTER_SIZE 4
#endif
-#define REGISTER_BYTES_FP (16*4 + 8 + 8*12 + 3*4)
-#define REGISTER_BYTES_NOFP (16*4 + 8)
-
-
-#ifndef NUM_REGS
-#define NUM_REGS 29
-#endif
-
-
-#define NUM_FREGS (NUM_REGS-24)
-
#if !GDB_MULTI_ARCH
#ifndef REGISTER_BYTES_OK
#define REGISTER_BYTES_OK(b) \
to be actual register numbers as far as the user is concerned
but do serve to get the desired values when passed to read_register. */
+
#define D0_REGNUM 0
#define A0_REGNUM 8
#define A1_REGNUM 9
+#if !GDB_MULTI_ARCH
#define FP_REGNUM 14 /* Contains address of executing stack frame */
#define SP_REGNUM 15 /* Contains address of top of stack */
#define PS_REGNUM 16 /* Contains processor status */
#define PC_REGNUM 17 /* Contains program counter */
#define FP0_REGNUM 18 /* Floating point register 0 */
+#endif
#define FPC_REGNUM 26 /* 68881 control register */
#define FPS_REGNUM 27 /* 68881 status register */
#define FPI_REGNUM 28 /* 68881 iaddr register */
(((FI)->signal_handler_caller) ? 0 : frameless_look_for_prologue(FI))
#endif
-/* This was determined by experimentation on hp300 BSD 4.3. Perhaps
- it corresponds to some offset in /usr/include/sys/user.h or
- something like that. Using some system include file would
- have the advantage of probably being more robust in the face
- of OS upgrades, but the disadvantage of being wrong for
- cross-debugging. */
-#define SIG_PC_FP_OFFSET 530
#if !GDB_MULTI_ARCH
#define FRAME_SAVED_PC(FRAME) \
)
#endif
+#if !GDB_MULTI_ARCH
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
+#endif
/* Set VAL to the number of args passed to frame described by FI.
Can set VAL to -1, meaning no way to tell. */
/* We can't tell how many args there are
now that the C compiler delays popping them. */
+#if !GDB_MULTI_ARCH
#if !defined (FRAME_NUM_ARGS)
#define FRAME_NUM_ARGS(fi) (-1)
#endif
+
/* Return number of bytes at start of arglist that are not really args. */
#define FRAME_ARGS_SKIP 8
+#endif
/* Put here the code to store, into a struct frame_saved_regs,
the addresses of the saved registers of frame described by FRAME_INFO.
/* Discard from the stack the innermost frame, restoring all registers. */
#define POP_FRAME { m68k_pop_frame (); }
-#endif
-/* Offset from SP to first arg on stack at first instruction of a function */
-
-#define SP_ARG0 (1 * 4)
-#define TARGET_M68K
/* Figure out where the longjmp will land. Slurp the args out of the stack.
We expect the first arg to be a pointer to the jmp_buf structure from which
This routine returns true on success */
extern int m68k_get_longjmp_target (CORE_ADDR *);
+#endif
#define P_FMOVM 0xf237
#define P_TRAP 0x4e40
+enum
+{
+ E_FP_REGNUM = 14, /* Contains address of executing stack frame */
+ E_SP_REGNUM = 15, /* Contains address of top of stack */
+ E_PS_REGNUM = 16, /* Contains processor status */
+ E_PC_REGNUM = 17, /* Contains program counter */
+ E_FP0_REGNUM = 18 /* Floating point register 0 */
+};
+
void m68k_frame_init_saved_regs (struct frame_info *frame_info);
static int
#if 0
tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
#endif
-
+
gdbarch = gdbarch_alloc (&info, 0);
set_gdbarch_long_double_format (gdbarch, &floatformat_m68881_ext);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_stack_align (gdbarch, m68k_stack_align);
+
+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_decr_pc_after_break (gdbarch, 2);
set_gdbarch_store_struct_return (gdbarch, m68k_store_struct_return);
set_gdbarch_store_return_value (gdbarch, m68k_store_return_value);
set_gdbarch_frame_chain (gdbarch, m68k_frame_chain);
+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, m68k_frame_saved_pc);
set_gdbarch_frame_init_saved_regs (gdbarch, m68k_frame_init_saved_regs);
set_gdbarch_frameless_function_invocation (gdbarch,
m68k_frameless_function_invocation);
+ /* OK to default this value to 'unknown'. */
+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+ set_gdbarch_frame_args_skip (gdbarch, 8);
+ set_gdbarch_frame_args_address (gdbarch, default_frame_address);
+ set_gdbarch_frame_locals_address (gdbarch, default_frame_address);
set_gdbarch_register_raw_size (gdbarch, m68k_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, m68k_register_virtual_size);
set_gdbarch_num_regs (gdbarch, 29);
set_gdbarch_register_bytes_ok (gdbarch, m68k_register_bytes_ok);
set_gdbarch_register_bytes (gdbarch, (16 * 4 + 8 + 8 * 12 + 3 * 4));
+ set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM);
+ set_gdbarch_fp_regnum (gdbarch, E_FP_REGNUM);
+ set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
+ set_gdbarch_ps_regnum (gdbarch, E_PS_REGNUM);
+ set_gdbarch_fp0_regnum (gdbarch, E_FP0_REGNUM);
set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);