+ static unsigned char break_insn[] = {0x4e, (0x40 | REMOTE_BPT_VECTOR)};
+ *lenptr = sizeof (break_insn);
+ return break_insn;
+}
+
+const static unsigned char *
+m68k_local_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+{
+ static unsigned char break_insn[] = {0x4e, (0x40 | BPT_VECTOR)};
+ *lenptr = sizeof (break_insn);
+ return break_insn;
+}
+
+
+static int
+m68k_register_bytes_ok (long numbytes)
+{
+ return ((numbytes == REGISTER_BYTES_FP)
+ || (numbytes == REGISTER_BYTES_NOFP));
+}
+
+/* Number of bytes of storage in the actual machine representation
+ for register regnum. On the 68000, all regs are 4 bytes
+ except the floating point regs which are 12 bytes. */
+/* Note that the unsigned cast here forces the result of the
+ subtraction to very high positive values if regnum < FP0_REGNUM */
+
+static int
+m68k_register_raw_size (int regnum)
+{
+ return (((unsigned) (regnum) - FP0_REGNUM) < 8 ? 12 : 4);
+}
+
+/* Number of bytes of storage in the program's representation
+ for register regnum. On the 68000, all regs are 4 bytes
+ except the floating point regs which are 12-byte long doubles. */
+
+static int
+m68k_register_virtual_size (int regnum)
+{
+ return (((unsigned) (regnum) - FP0_REGNUM) < 8 ? 12 : 4);
+}
+
+/* Return the GDB type object for the "standard" data type of data in
+ register N. This should be int for D0-D7, SR, FPCONTROL and
+ FPSTATUS, long double for FP0-FP7, and void pointer for all others
+ (A0-A7, PC, FPIADDR). Note, for registers which contain
+ addresses return pointer to void, not pointer to char, because we
+ don't want to attempt to print the string after printing the
+ address. */
+
+static struct type *
+m68k_register_virtual_type (int regnum)
+{
+ if (regnum >= FP0_REGNUM && regnum <= FP0_REGNUM + 7)
+ return builtin_type_m68881_ext;
+
+ if (regnum == M68K_FPI_REGNUM || regnum == PC_REGNUM)
+ return builtin_type_void_func_ptr;
+
+ if (regnum == M68K_FPC_REGNUM || regnum == M68K_FPS_REGNUM
+ || regnum == PS_REGNUM)
+ return builtin_type_int32;
+
+ if (regnum >= M68K_A0_REGNUM && regnum <= M68K_A0_REGNUM + 7)
+ return builtin_type_void_data_ptr;
+
+ return builtin_type_int32;
+}
+
+/* Function: m68k_register_name
+ Returns the name of the standard m68k register regnum. */
+
+static const char *
+m68k_register_name (int regnum)
+{
+ static char *register_names[] = {
+ "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
+ "a0", "a1", "a2", "a3", "a4", "a5", "fp", "sp",
+ "ps", "pc",
+ "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7",
+ "fpcontrol", "fpstatus", "fpiaddr", "fpcode", "fpflags"
+ };
+
+ if (regnum < 0 ||
+ regnum >= sizeof (register_names) / sizeof (register_names[0]))
+ internal_error (__FILE__, __LINE__,
+ "m68k_register_name: illegal register number %d", regnum);
+ else
+ return register_names[regnum];
+}
+
+/* Stack must be kept short aligned when doing function calls. */
+
+static CORE_ADDR
+m68k_stack_align (CORE_ADDR addr)
+{
+ return ((addr + 1) & ~1);
+}
+
+/* Index within `registers' of the first byte of the space for
+ register regnum. */
+
+static int
+m68k_register_byte (int regnum)
+{
+ if (regnum >= M68K_FPC_REGNUM)
+ return (((regnum - M68K_FPC_REGNUM) * 4) + 168);
+ else if (regnum >= FP0_REGNUM)
+ return (((regnum - FP0_REGNUM) * 12) + 72);
+ else
+ return (regnum * 4);
+}
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function. */
+
+static void
+m68k_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ write_register (M68K_A1_REGNUM, addr);
+}
+
+/* Extract from an array regbuf containing the (raw) register state
+ a function return value of type type, and copy that, in virtual format,
+ into valbuf. This is assuming that floating point values are returned
+ as doubles in d0/d1. */
+
+static void
+m68k_deprecated_extract_return_value (struct type *type, char *regbuf,
+ char *valbuf)
+{
+ int offset = 0;
+ int typeLength = TYPE_LENGTH (type);
+
+ if (typeLength < 4)
+ offset = 4 - typeLength;
+
+ memcpy (valbuf, regbuf + offset, typeLength);
+}
+
+static CORE_ADDR
+m68k_deprecated_extract_struct_value_address (char *regbuf)
+{
+ return (*(CORE_ADDR *) (regbuf));
+}
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. Assumes floats are passed
+ in d0/d1. */
+
+static void
+m68k_store_return_value (struct type *type, char *valbuf)
+{
+ deprecated_write_register_bytes (0, valbuf, TYPE_LENGTH (type));
+}
+
+/* Describe the pointer in each stack frame to the previous stack frame
+ (its caller). */
+
+/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces
+ the frame's chain-pointer. In the case of the 68000, the frame's
+ nominal address is the address of a 4-byte word containing the
+ calling frame's address. */
+
+/* If we are chaining from sigtramp, then manufacture a sigtramp frame
+ (which isn't really on the stack. I'm not sure this is right for anything
+ but BSD4.3 on an hp300. */
+
+static CORE_ADDR
+m68k_frame_chain (struct frame_info *thisframe)
+{
+ if (get_frame_type (thisframe) == SIGTRAMP_FRAME)
+ return get_frame_base (thisframe);
+ else if (!inside_entry_file (get_frame_pc (thisframe)))
+ return read_memory_unsigned_integer (get_frame_base (thisframe), 4);
+ else
+ return 0;
+}
+
+/* A function that tells us whether the function invocation represented
+ by fi does not have a frame on the stack associated with it. If it
+ does not, FRAMELESS is set to 1, else 0. */
+
+static int
+m68k_frameless_function_invocation (struct frame_info *fi)
+{
+ if (get_frame_type (fi) == SIGTRAMP_FRAME)
+ return 0;
+ else
+ return frameless_look_for_prologue (fi);
+}
+
+static CORE_ADDR
+m68k_frame_saved_pc (struct frame_info *frame)
+{
+ if (get_frame_type (frame) == SIGTRAMP_FRAME)
+ {
+ if (get_next_frame (frame))
+ return read_memory_unsigned_integer (get_frame_base (get_next_frame (frame))
+ + SIG_PC_FP_OFFSET, 4);
+ else
+ return read_memory_unsigned_integer (read_register (SP_REGNUM)
+ + SIG_PC_FP_OFFSET - 8, 4);
+ }
+ else
+ return read_memory_unsigned_integer (get_frame_base (frame) + 4, 4);