73static const char *
const moxie_register_names[] = {
74 "$fp",
"$sp",
"$r0",
"$r1",
"$r2",
75 "$r3",
"$r4",
"$r5",
"$r6",
"$r7",
76 "$r8",
"$r9",
"$r10",
"$r11",
"$r12",
77 "$r13",
"$pc",
"$cc" };
85 return moxie_register_names[reg_nr];
106 const gdb_byte *valbuf)
136 ULONGEST inst, inst2;
145 if (start_addr >= end_addr)
148 for (next_addr = start_addr; next_addr < end_addr; )
153 if (inst >= 0x0612 && inst <= 0x061f)
178 return (next_addr + 8);
180 else if ((inst & 0xff00) == 0x9100)
185 while (next_addr < end_addr)
188 if ((inst & 0xff00) != 0x9100)
203 CORE_ADDR func_addr = 0, func_end = 0;
204 const char *func_name;
211 CORE_ADDR post_prologue_pc
213 if (post_prologue_pc != 0)
214 return std::max (pc, post_prologue_pc);
224 memset (&cache, 0,
sizeof cache);
235 if (sal.
end && sal.
end < func_end)
249 return (CORE_ADDR)
pc;
274 int length,
enum bfd_endian byte_order)
280 _(
"Process record: error reading memory at "
281 "addr 0x%s len = %d.\n"),
292#define INST2OFFSET(o) ((((signed short)((o & ((1<<10)-1))<<6))>>6)<<1)
296static std::vector<CORE_ADDR>
306 std::vector<CORE_ADDR> next_pcs;
313 if (inst & (1 << 15))
315 if (inst & (1 << 14))
318 int opcode = (inst >> 10 & 0xf);
334 next_pcs.push_back (addr + 2);
347 next_pcs.push_back (addr + 2);
353 int opcode = inst >> 8;
394 next_pcs.push_back (addr + 2);
404 next_pcs.push_back (addr + 4);
417 next_pcs.push_back (addr + 6);
435 next_pcs.push_back (tmpu32);
479 gdb_byte *readbuf,
const gdb_byte *writebuf)
481 if (valtype->
length () > 8)
487 if (writebuf != NULL)
519 CORE_ADDR current_pc;
529 if (cache->
base == 0)
554 void **this_prologue_cache,
struct frame_id *this_id)
557 this_prologue_cache);
560 if (cache->
base == 0)
570 void **this_prologue_cache,
int regnum)
573 this_prologue_cache);
636 if (inst & (1 << 15))
638 if (inst & (1 << 14))
641 int opcode = (inst >> 10 & 0xf);
667 int opcode = (inst >> 12 & 0x3);
674 int reg = (inst >> 8) & 0xf;
694 int opcode = inst >> 8;
704 int reg = (inst >> 4) & 0xf;
732 int reg = (inst >> 4) & 0xf;
739 int reg = (inst >> 4) & 0xf;
750 int a = (inst >> 4) & 0xf;
759 int reg = (inst >> 4) & 0xf;
774 int reg = (inst >> 4) & 0xf;
781 int reg = (inst >> 4) & 0xf;
791 int reg = (inst >> 4) & 0xf;
798 int reg = (inst >> 4) & 0xf;
800 byte_order)) << 16 ) >> 16;
827 int reg = (inst >> 4) & 0xf;
861 int reg = (inst >> 4) & 0xf;
868 int reg = (inst >> 4) & 0xf;
887 int reg = (inst >> 4) & 0xf;
894 int reg = (inst >> 4) & 0xf;
925 int reg = (inst >> 4) & 0xf;
952 uint32_t length, ptr;
986 int reg = (inst >> 4) & 0xf;
996 int reg = (inst >> 4) & 0xf;
1003 int reg = (inst >> 4) & 0xf;
1005 byte_order)) << 16 ) >> 16;
1016 int reg = (inst >> 4) & 0xf;
1023 int reg = (inst >> 4) & 0xf;
1025 byte_order)) << 16 ) >> 16;
1075 moxie_breakpoint::kind_from_pc);
1077 moxie_breakpoint::bp_from_kind);
gdb_static_assert(sizeof(splay_tree_key) >=sizeof(CORE_ADDR *))
void gdbarch_register(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init, gdbarch_dump_tdep_ftype *dump_tdep, gdbarch_supports_arch_info_ftype *supports_arch_info)
struct gdbarch * target_gdbarch(void)
static std::vector< const char * > arches
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
#define BP_MANIPULATION(BREAK_INSN)
bool find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr, const struct block **block)
enum register_status raw_read(int regnum, gdb_byte *buf)
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
LONGEST read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
@ RETURN_VALUE_REGISTER_CONVENTION
@ RETURN_VALUE_STRUCT_CONVENTION
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
int default_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
struct value * frame_unwind_got_memory(frame_info_ptr frame, int regnum, CORE_ADDR addr)
struct value * frame_unwind_got_register(frame_info_ptr frame, int regnum, int new_regnum)
enum unwind_stop_reason default_frame_unwind_stop_reason(frame_info_ptr this_frame, void **this_cache)
struct value * frame_unwind_got_constant(frame_info_ptr frame, int regnum, ULONGEST val)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
ULONGEST get_frame_register_unsigned(frame_info_ptr frame, int regnum)
CORE_ADDR get_frame_pc(frame_info_ptr frame)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
CORE_ADDR get_frame_func(frame_info_ptr this_frame)
#define FRAME_OBSTACK_ZALLOC(TYPE)
void set_gdbarch_process_record(struct gdbarch *gdbarch, gdbarch_process_record_ftype *process_record)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
void set_gdbarch_breakpoint_kind_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_pc_ftype *breakpoint_kind_from_pc)
void set_gdbarch_software_single_step(struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step)
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align)
void set_gdbarch_skip_prologue(struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue)
void set_gdbarch_wchar_bit(struct gdbarch *gdbarch, int wchar_bit)
void set_gdbarch_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name)
void set_gdbarch_overlay_update(struct gdbarch *gdbarch, gdbarch_overlay_update_ftype *overlay_update)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value)
void set_gdbarch_wchar_signed(struct gdbarch *gdbarch, int wchar_signed)
void set_gdbarch_inner_than(struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than)
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type)
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
void set_gdbarch_sw_breakpoint_from_kind(struct gdbarch *gdbarch, gdbarch_sw_breakpoint_from_kind_ftype *sw_breakpoint_from_kind)
struct gdbarch * gdbarch_alloc(const struct gdbarch_info *info, gdbarch_tdep_up tdep)
std::unique_ptr< gdbarch_tdep_base > gdbarch_tdep_up
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
static const char * moxie_register_name(struct gdbarch *gdbarch, int reg_nr)
static struct gdbarch * moxie_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
static const struct frame_unwind moxie_frame_unwind
static void moxie_extract_return_value(struct type *type, struct regcache *regcache, gdb_byte *dst)
static struct value * moxie_frame_prev_register(frame_info_ptr this_frame, void **this_prologue_cache, int regnum)
static int moxie_process_record(struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr)
static std::vector< CORE_ADDR > moxie_software_single_step(struct regcache *regcache)
static struct type * moxie_register_type(struct gdbarch *gdbarch, int reg_nr)
void _initialize_moxie_tdep()
static CORE_ADDR moxie_frame_base_address(frame_info_ptr this_frame, void **this_cache)
static struct moxie_frame_cache * moxie_alloc_frame_cache(void)
static CORE_ADDR moxie_frame_align(struct gdbarch *gdbarch, CORE_ADDR sp)
static CORE_ADDR moxie_analyze_prologue(CORE_ADDR start_addr, CORE_ADDR end_addr, struct moxie_frame_cache *cache, struct gdbarch *gdbarch)
static void moxie_store_return_value(struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
static enum return_value_convention moxie_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
constexpr gdb_byte moxie_break_insn[]
static CORE_ADDR moxie_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
static void moxie_frame_this_id(frame_info_ptr this_frame, void **this_prologue_cache, struct frame_id *this_id)
static const struct frame_base moxie_frame_base
static ULONGEST moxie_process_readu(CORE_ADDR addr, gdb_byte *buf, int length, enum bfd_endian byte_order)
static struct moxie_frame_cache * moxie_frame_cache(frame_info_ptr this_frame, void **this_cache)
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
int record_full_arch_list_add_reg(struct regcache *regcache, int regnum)
int record_full_arch_list_add_mem(CORE_ADDR addr, int len)
int record_full_arch_list_add_end(void)
unsigned int record_debug
CORE_ADDR regcache_read_pc(struct regcache *regcache)
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
struct type * builtin_func_ptr
struct type * builtin_data_ptr
struct type * builtin_int32
enum language language() const
CORE_ADDR saved_regs[MOXIE_NUM_REGS]
trad_frame_saved_reg * saved_regs
void simple_overlay_update(struct obj_section *osect)
struct block_symbol lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
CORE_ADDR skip_prologue_using_sal(struct gdbarch *gdbarch, CORE_ADDR func_addr)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void gdb_printf(struct ui_file *stream, const char *format,...)