35 #include "floatformat.h" 41 #define P_LINKL_FP 0x480e 42 #define P_LINKW_FP 0x4e56 43 #define P_PEA_FP 0x4856 44 #define P_MOVEAL_SP_FP 0x2c4f 45 #define P_ADDAW_SP 0xdefc 46 #define P_ADDAL_SP 0xdffc 47 #define P_SUBQW_SP 0x514f 48 #define P_SUBQL_SP 0x518f 49 #define P_LEA_SP_SP 0x4fef 50 #define P_LEA_PC_A5 0x4bfb0170 51 #define P_FMOVEMX_SP 0xf227 52 #define P_MOVEL_SP 0x2f00 53 #define P_MOVEML_SP 0x48e7 56 #define SP_ARG0 (1 * 4) 58 #if !defined (BPT_VECTOR) 59 #define BPT_VECTOR 0xf 159 "d0",
"d1",
"d2",
"d3",
"d4",
"d5",
"d6",
"d7",
160 "a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"fp",
"sp",
162 "fp0",
"fp1",
"fp2",
"fp3",
"fp4",
"fp5",
"fp6",
"fp7",
163 "fpcontrol",
"fpstatus",
"fpiaddr" 174 _(
"m68k_register_name: illegal register number %d"),
204 int *optimizedp,
int *unavailablep)
215 from, optimizedp, unavailablep))
219 *optimizedp = *unavailablep = 0;
237 warning (
_(
"Cannot convert non-floating-point type " 238 "to floating-point register value."));
290 memcpy (valbuf, buf + (4 - len), len);
295 memcpy (valbuf, buf + (8 - len), len - 4);
300 _(
"Cannot extract return value of %d bytes long."), len);
341 _(
"Cannot store return value of %d bytes long."), len);
384 return (len == 1 || len == 2 || len == 4 || len == 8);
505 for (i = nargs - 1; i >= 0; i--)
509 int container_len = (len + 3) & ~3;
520 offset = container_len - len;
626 if (
pc >= current_pc)
641 if (
pc + 4 < current_pc && cache->
locals == 0)
664 if (
pc + 2 < current_pc)
682 cache->
locals = (op & 07000) == 0 ? 8 : (op & 07000) >> 9;
683 if (
pc + 2 < current_pc)
688 cache->
locals += (op & 07000) == 0 ? 8 : (op & 07000) >> 9;
730 while (
pc < current_pc)
738 if ((op & 0xff00) == 0xe000)
741 for (i = 0; i < 16; i++, mask >>= 1)
766 for (i = 0; i < 16; i++, mask >>= 1)
826 if (
pc >= current_pc)
892 if (cache->
base == 0)
938 if (cache->
base == 0)
945 static struct value *
1015 if (tdep->
jb_pc < 0)
1018 _(
"m68k_get_longjmp_target: not implemented"));
1091 "org.gnu.gdb.m68k.core");
1093 if (feature == NULL)
1096 "org.gnu.gdb.coldfire.core");
1097 if (feature != NULL)
1101 if (feature == NULL)
1104 "org.gnu.gdb.fido.core");
1105 if (feature != NULL)
1109 if (feature == NULL)
1126 "org.gnu.gdb.coldfire.fp");
1127 if (feature != NULL)
1149 const bfd_arch_info_type *coldfire_arch =
1150 bfd_lookup_arch (bfd_arch_m68k, bfd_mach_mcf_isa_a_nodiv);
1172 if (best_arch != NULL)
1239 #if defined JB_PC && defined JB_ELEMENT_SIZE 1240 tdep->
jb_pc = JB_PC;
1263 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)
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 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)
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 * value_enclosing_type(const struct value *value)
#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 target_float_convert(const gdb_byte *from, const struct type *from_type, gdb_byte *to, const struct type *to_type)
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)
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)
struct type * builtin_int32
#define FRAME_OBSTACK_ZALLOC(TYPE)
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 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)
constexpr gdb_byte m68k_break_insn[]
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 * arch_flags_type(struct gdbarch *gdbarch, const char *name, int bit)
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]
static CORE_ADDR m68k_unwind_pc(struct gdbarch *gdbarch, struct frame_info *next_frame)
enum struct_return struct_return
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)
static ULONGEST extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
struct type * arch_float_type(struct gdbarch *gdbarch, int bit, const char *name, const struct floatformat **floatformats)
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)
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)
typedef BP_MANIPULATION(m68k_break_insn)
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
void append_flags_type_flag(struct type *type, int bitpos, const char *name)
static struct m68k_frame_cache * m68k_frame_cache(struct frame_info *this_frame, void **this_cache)
static const struct frame_base m68k_frame_base
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_breakpoint_kind_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_pc_ftype breakpoint_kind_from_pc)
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)
int register_size(struct gdbarch *gdbarch, int regnum)
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
enum register_status regcache_raw_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
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)
void set_gdbarch_sw_breakpoint_from_kind(struct gdbarch *gdbarch, gdbarch_sw_breakpoint_from_kind_ftype sw_breakpoint_from_kind)
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)
static const char * m68k_register_names[]
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)
void _initialize_m68k_tdep(void)
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)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
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)
static int m68k_get_longjmp_target(struct frame_info *frame, CORE_ADDR *pc)