39 #define P_LINKL_FP 0x480e
40 #define P_LINKW_FP 0x4e56
41 #define P_PEA_FP 0x4856
42 #define P_MOVEAL_SP_FP 0x2c4f
43 #define P_ADDAW_SP 0xdefc
44 #define P_ADDAL_SP 0xdffc
45 #define P_SUBQW_SP 0x514f
46 #define P_SUBQL_SP 0x518f
47 #define P_LEA_SP_SP 0x4fef
48 #define P_LEA_PC_A5 0x4bfb0170
49 #define P_FMOVEMX_SP 0xf227
50 #define P_MOVEL_SP 0x2f00
51 #define P_MOVEML_SP 0x48e7
54 #define SP_ARG0 (1 * 4)
56 #if !defined (BPT_VECTOR)
57 #define BPT_VECTOR 0xf
65 *lenptr =
sizeof (break_insn);
161 static const char *m68k_register_names[] = {
162 "d0",
"d1",
"d2",
"d3",
"d4",
"d5",
"d6",
"d7",
163 "a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"fp",
"sp",
165 "fp0",
"fp1",
"fp2",
"fp3",
"fp4",
"fp5",
"fp6",
"fp7",
166 "fpcontrol",
"fpstatus",
"fpiaddr"
175 if (regnum < 0 || regnum >= ARRAY_SIZE (m68k_register_names))
177 _(
"m68k_register_name: illegal register number %d"),
183 return m68k_register_names[
regnum];
205 int *optimizedp,
int *unavailablep)
214 warning (
_(
"Cannot convert floating-point register value "
215 "to non-floating-point type."));
216 *optimizedp = *unavailablep = 0;
224 from, optimizedp, unavailablep))
228 *optimizedp = *unavailablep = 0;
246 warning (
_(
"Cannot convert non-floating-point type "
247 "to floating-point register value."));
299 memcpy (valbuf, buf + (4 - len), len);
304 memcpy (valbuf, buf + (8 - len), len - 4);
309 _(
"Cannot extract return value of %d bytes long."), len);
350 _(
"Cannot store return value of %d bytes long."), len);
393 return (len == 1 || len == 2 || len == 4 || len == 8);
514 for (i = nargs - 1; i >= 0; i--)
518 int container_len = (len + 3) & ~3;
529 offset = container_len -
len;
569 else if (num < 24 &&
gdbarch_tdep (gdbarch)->fpregs_present)
635 if (pc >= current_pc)
650 if (pc + 4 < current_pc && cache->
locals == 0)
673 if (pc + 2 < current_pc)
691 cache->
locals = (op & 07000) == 0 ? 8 : (op & 07000) >> 9;
692 if (pc + 2 < current_pc)
697 cache->
locals += (op & 07000) == 0 ? 8 : (op & 07000) >> 9;
738 offset = -4 - cache->
locals;
739 while (pc < current_pc)
747 if ((op & 0xff00) == 0xe000)
750 for (i = 0; i < 16; i++, mask >>= 1)
775 for (i = 0; i < 16; i++, mask >>= 1)
835 if (pc >= current_pc)
901 if (cache->
base == 0)
947 if (cache->
base == 0)
954 static struct value *
965 if (regnum < M68K_NUM_REGS && cache->
saved_regs[regnum] != -1)
995 m68k_frame_base_address
1024 if (tdep->
jb_pc < 0)
1027 _(
"m68k_get_longjmp_target: not implemented"));
1081 static struct gdbarch *
1085 struct gdbarch *gdbarch;
1100 "org.gnu.gdb.m68k.core");
1102 if (feature == NULL)
1105 "org.gnu.gdb.coldfire.core");
1106 if (feature != NULL)
1110 if (feature == NULL)
1113 "org.gnu.gdb.fido.core");
1114 if (feature != NULL)
1118 if (feature == NULL)
1126 m68k_register_names[i]);
1135 "org.gnu.gdb.coldfire.fp");
1136 if (feature != NULL)
1141 m68k_register_names[i]);
1158 const bfd_arch_info_type *coldfire_arch =
1159 bfd_lookup_arch (bfd_arch_m68k, bfd_mach_mcf_isa_a_nodiv);
1181 if (best_arch != NULL)
1183 if (tdesc_data != NULL)
1251 #if defined JB_PC && defined JB_ELEMENT_SIZE
1252 tdep->
jb_pc = JB_PC;
1275 if (tdep->
jb_pc >= 0)
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype frame_align)
void m68k_svr4_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
void set_gdbarch_value_to_register(struct gdbarch *gdbarch, gdbarch_value_to_register_ftype value_to_register)
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
void set_gdbarch_ps_regnum(struct gdbarch *gdbarch, int ps_regnum)
static int m68k_dwarf_reg_to_regnum(struct gdbarch *gdbarch, int num)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
void set_gdbarch_get_longjmp_target(struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype get_longjmp_target)
struct type * builtin_func_ptr
CORE_ADDR get_frame_pc(struct frame_info *frame)
static int m68k_return_in_first_hidden_param_p(struct gdbarch *gdbarch, struct type *type)
void set_gdbarch_fp0_regnum(struct gdbarch *gdbarch, int fp0_regnum)
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
const struct floatformat * floatformats_ieee_double[BFD_ENDIAN_UNKNOWN]
static CORE_ADDR m68k_frame_base_address(struct frame_info *this_frame, void **this_cache)
static int m68k_register_to_value(struct frame_info *frame, int regnum, struct type *type, gdb_byte *to, int *optimizedp, int *unavailablep)
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
struct value * frame_unwind_got_memory(struct frame_info *frame, int regnum, CORE_ADDR addr)
static void m68k_value_to_register(struct frame_info *frame, int regnum, struct type *type, const gdb_byte *from)
struct type * arch_flags_type(struct gdbarch *gdbarch, char *name, int length)
void warning(const char *fmt,...)
static struct value * m68k_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
struct type * arch_float_type(struct gdbarch *gdbarch, int bit, char *name, const struct floatformat **floatformats)
void convert_typed_floating(const void *from, const struct type *from_type, void *to, const struct type *to_type)
#define M68K_MAX_REGISTER_SIZE
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
CORE_ADDR saved_regs[M68K_NUM_REGS]
void internal_error(const char *file, int line, const char *fmt,...)
void frame_unwind_register(struct frame_info *frame, int regnum, gdb_byte *buf)
static int m68k_convert_register_p(struct gdbarch *gdbarch, int regnum, struct type *type)
void append_flags_type_flag(struct type *type, int bitpos, char *name)
static const gdb_byte * m68k_local_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
static void m68k_extract_return_value(struct type *type, struct regcache *regcache, gdb_byte *valbuf)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
struct gdbarch_list * next
static void m68k_store_return_value(struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
int gdbarch_num_regs(struct gdbarch *gdbarch)
const struct bfd_arch_info * bfd_arch_info
void set_gdbarch_return_in_first_hidden_param_p(struct gdbarch *gdbarch, gdbarch_return_in_first_hidden_param_p_ftype return_in_first_hidden_param_p)
enum m68k_flavour flavour
void set_gdbarch_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
void tdesc_data_cleanup(void *data_untyped)
static int m68k_reg_struct_return_p(struct gdbarch *gdbarch, struct type *type)
#define TYPE_FIELD_TYPE(thistype, n)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
static struct type * m68k_ps_type(struct gdbarch *gdbarch)
struct type * builtin_int32
#define FRAME_OBSTACK_ZALLOC(TYPE)
void store_unsigned_integer(gdb_byte *, int, enum bfd_endian, ULONGEST)
struct value * frame_unwind_got_constant(struct frame_info *frame, int regnum, ULONGEST val)
void gdbarch_register(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init, gdbarch_dump_tdep_ftype *dump_tdep)
static struct m68k_frame_cache * m68k_alloc_frame_cache(void)
int gdbarch_num_pseudo_regs(struct gdbarch *gdbarch)
int tdesc_numbered_register(const struct tdesc_feature *feature, struct tdesc_arch_data *data, int regno, const char *name)
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
static CORE_ADDR m68k_analyze_register_saves(struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, struct m68k_frame_cache *cache)
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype register_type)
struct type * check_typedef(struct type *type)
static struct frame_id m68k_dummy_id(struct gdbarch *gdbarch, struct frame_info *this_frame)
LONGEST read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
const struct floatformat * floatformats_m68881_ext[BFD_ENDIAN_UNKNOWN]
initialize_file_ftype _initialize_m68k_tdep
static CORE_ADDR m68k_unwind_pc(struct gdbarch *gdbarch, struct frame_info *next_frame)
enum struct_return struct_return
void initialize_file_ftype(void)
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
static CORE_ADDR m68k_analyze_prologue(struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, struct m68k_frame_cache *cache)
void * xzalloc(size_t size)
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
void set_gdbarch_decr_pc_after_break(struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break)
struct type * register_type(struct gdbarch *gdbarch, int regnum)
void set_gdbarch_dummy_id(struct gdbarch *gdbarch, gdbarch_dummy_id_ftype dummy_id)
static void m68k_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
void set_gdbarch_believe_pcc_promotion(struct gdbarch *gdbarch, int believe_pcc_promotion)
const gdb_byte * value_contents_all(struct value *value)
static CORE_ADDR m68k_push_dummy_call(struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
struct type * value_enclosing_type(struct value *value)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
static enum return_value_convention m68k_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static struct type * m68881_ext_type(struct gdbarch *gdbarch)
struct type * builtin_int0
void set_gdbarch_register_to_value(struct gdbarch *gdbarch, gdbarch_register_to_value_ftype register_to_value)
void set_gdbarch_unwind_pc(struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype unwind_pc)
void set_gdbarch_breakpoint_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
enum register_status regcache_raw_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
static struct m68k_frame_cache * m68k_frame_cache(struct frame_info *this_frame, void **this_cache)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
void set_gdbarch_frame_args_skip(struct gdbarch *gdbarch, CORE_ADDR frame_args_skip)
static const char * m68k_register_name(struct gdbarch *gdbarch, int regnum)
void put_frame_register(struct frame_info *frame, int regnum, const gdb_byte *buf)
const struct target_desc * target_desc
void regcache_raw_write_part(struct regcache *regcache, int regnum, int offset, int len, const gdb_byte *buf)
void tdesc_use_registers(struct gdbarch *gdbarch, const struct target_desc *target_desc, struct tdesc_arch_data *early_data)
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
struct type * builtin_double
void set_gdbarch_convert_register_p(struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype convert_register_p)
int gdbarch_fp0_regnum(struct gdbarch *gdbarch)
#define TYPE_CODE(thistype)
enum register_status regcache_raw_read(struct regcache *regcache, int regnum, gdb_byte *buf)
struct value * frame_unwind_got_register(struct frame_info *frame, int regnum, int new_regnum)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
struct type * builtin_data_ptr
static CORE_ADDR m68k_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR start_pc)
void get_frame_register(struct frame_info *frame, int regnum, gdb_byte *buf)
#define TYPE_NFIELDS(thistype)
static const struct frame_unwind m68k_frame_unwind
void dwarf2_append_unwinders(struct gdbarch *gdbarch)
static CORE_ADDR m68k_analyze_frame_setup(struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, struct m68k_frame_cache *cache)
struct tdesc_arch_data * tdesc_data_alloc(void)
int get_frame_register_bytes(struct frame_info *frame, int regnum, CORE_ADDR offset, int len, gdb_byte *myaddr, int *optimizedp, int *unavailablep)
unsigned long long ULONGEST
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
const struct tdesc_feature * tdesc_find_feature(const struct target_desc *target_desc, const char *name)
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
struct type * value_type(const struct value *value)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
void set_gdbarch_long_double_format(struct gdbarch *gdbarch, const struct floatformat **long_double_format)
#define TYPE_LENGTH(thistype)
struct type * m68881_ext_type
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype push_dummy_call)
static void m68k_svr4_store_return_value(struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
static CORE_ADDR m68k_frame_align(struct gdbarch *gdbarch, CORE_ADDR sp)
static struct gdbarch * m68k_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
void set_gdbarch_skip_prologue(struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype skip_prologue)
static struct gdbarch_data * tdesc_data
enum bfd_endian byte_order
struct type * m68k_ps_type
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
int tdesc_has_registers(const struct target_desc *target_desc)
void set_gdbarch_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype register_name)
CORE_ADDR get_frame_func(struct frame_info *this_frame)
struct gdbarch * gdbarch_alloc(const struct gdbarch_info *info, struct gdbarch_tdep *tdep)
void set_gdbarch_inner_than(struct gdbarch *gdbarch, gdbarch_inner_than_ftype inner_than)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
void regcache_cooked_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
static void m68k_dump_tdep(struct gdbarch *gdbarch, struct ui_file *file)
static void m68k_svr4_extract_return_value(struct type *type, struct regcache *regcache, gdb_byte *valbuf)
void set_gdbarch_print_insn(struct gdbarch *gdbarch, gdbarch_print_insn_ftype print_insn)
static enum return_value_convention m68k_svr4_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static struct type * m68k_register_type(struct gdbarch *gdbarch, int regnum)
void regcache_raw_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
const ULONGEST const LONGEST len
static int m68k_get_longjmp_target(struct frame_info *frame, CORE_ADDR *pc)