GDB (xrefs)
|
#include "defs.h"
#include "frame.h"
#include "frame-unwind.h"
#include "frame-base.h"
#include "trad-frame.h"
#include "dwarf2-frame.h"
#include "symtab.h"
#include "inferior.h"
#include "gdbtypes.h"
#include "gdbcore.h"
#include "gdbcmd.h"
#include "osabi.h"
#include "target.h"
#include "dis-asm.h"
#include "regcache.h"
#include "value.h"
#include "symfile.h"
#include "arch-utils.h"
#include "floatformat.h"
#include "infcall.h"
#include "regset.h"
#include "target-descriptions.h"
#include "objfiles.h"
#include "opcode/nios2.h"
#include "nios2-tdep.h"
#include "features/nios2.c"
Go to the source code of this file.
Classes | |
struct | reg_value |
struct | reg_saved |
struct | nios2_unwind_cache |
Enumerations | |
enum | branch_condition { branch_none, branch_eq, branch_ne, branch_ge, branch_geu, branch_lt, branch_ltu } |
Functions | |
static int | nios2_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dw_reg) |
static const char * | nios2_register_name (struct gdbarch *gdbarch, int regno) |
static struct type * | nios2_register_type (struct gdbarch *gdbarch, int regno) |
static void | nios2_extract_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *valbuf) |
static void | nios2_store_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, const gdb_byte *valbuf) |
static void | nios2_setup_default (struct nios2_unwind_cache *cache) |
static void | nios2_init_cache (struct nios2_unwind_cache *cache, CORE_ADDR pc) |
static const struct nios2_opcode * | nios2_fetch_insn (struct gdbarch *gdbarch, CORE_ADDR pc, unsigned int *insnp) |
static int | nios2_match_add (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *rc) |
static int | nios2_match_sub (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *rc) |
static int | nios2_match_addi (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *imm) |
static int | nios2_match_orhi (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, unsigned int *uimm) |
static int | nios2_match_stw (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *imm) |
static int | nios2_match_ldw (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *imm) |
static int | nios2_match_rdctl (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rc) |
static int | nios2_match_branch (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *imm, enum branch_condition *cond) |
static int | nios2_match_jmpi (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm) |
static int | nios2_match_calli (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm) |
static int | nios2_match_jmpr (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra) |
static int | nios2_match_callr (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra) |
static int | nios2_match_break (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm) |
static int | nios2_match_trap (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm) |
static int | nios2_in_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR current_pc, CORE_ADDR start_pc) |
static int | nios2_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) |
static CORE_ADDR | nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc, const CORE_ADDR current_pc, struct nios2_unwind_cache *cache, struct frame_info *this_frame) |
static CORE_ADDR | nios2_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) |
static const gdb_byte * | nios2_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *bp_addr, int *bp_size) |
static int | nios2_print_insn (bfd_vma memaddr, disassemble_info *info) |
static CORE_ADDR | nios2_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) |
static enum return_value_convention | nios2_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) |
static struct frame_id | nios2_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) |
static CORE_ADDR | nios2_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) |
static CORE_ADDR | nios2_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) |
static CORE_ADDR | nios2_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) |
static struct nios2_unwind_cache * | nios2_frame_unwind_cache (struct frame_info *this_frame, void **this_prologue_cache) |
static void | nios2_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id) |
static struct value * | nios2_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum) |
static CORE_ADDR | nios2_frame_base_address (struct frame_info *this_frame, void **this_cache) |
static struct trad_frame_cache * | nios2_stub_frame_cache (struct frame_info *this_frame, void **this_cache) |
static void | nios2_stub_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id) |
static struct value * | nios2_stub_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum) |
static int | nios2_stub_frame_sniffer (const struct frame_unwind *self, struct frame_info *this_frame, void **cache) |
static CORE_ADDR | nios2_get_next_pc (struct frame_info *frame, CORE_ADDR pc) |
static int | nios2_software_single_step (struct frame_info *frame) |
static int | nios2_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc) |
static struct gdbarch * | nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) |
void | _initialize_nios2_tdep (void) |
Variables | |
static int | nios2_debug = 0 |
static int | nios2_dwarf2gdb_regno_map [] |
static const char *const | nios2_reg_names [NIOS2_NUM_REGS] |
static const struct frame_unwind | nios2_frame_unwind |
static const struct frame_base | nios2_frame_base |
static const struct frame_unwind | nios2_stub_frame_unwind |
initialize_file_ftype | _initialize_nios2_tdep |
enum branch_condition |
Enumerator | |
---|---|
branch_none | |
branch_eq | |
branch_ne | |
branch_ge | |
branch_geu | |
branch_lt | |
branch_ltu |
Definition at line 428 of file nios2-tdep.c.
void _initialize_nios2_tdep | ( | void | ) |
Definition at line 1816 of file nios2-tdep.c.
References _, add_setshow_boolean_cmd(), class_maintenance, gdbarch_register(), initialize_tdesc_nios2(), nios2_debug, nios2_gdbarch_init(), setdebuglist, and showdebuglist.
|
static |
Definition at line 728 of file nios2-tdep.c.
References reg_saved::addr, nios2_unwind_cache::base, reg_saved::basereg, branch_geu, branch_ltu, nios2_unwind_cache::cfa, fprintf_unfiltered(), frame_relative_level(), gdb_stdlog, gdbarch_bfd_arch_info(), gdbarch_byte_order(), get_frame_register_unsigned(), nios2_debug, NIOS2_EA_REGNUM, NIOS2_ESTATUS_REGNUM, nios2_fetch_insn(), NIOS2_FP_REGNUM, NIOS2_GP_REGNUM, nios2_in_epilogue_p(), nios2_match_add(), nios2_match_addi(), nios2_match_branch(), nios2_match_break(), nios2_match_calli(), nios2_match_callr(), nios2_match_jmpi(), nios2_match_jmpr(), nios2_match_orhi(), nios2_match_rdctl(), nios2_match_stw(), nios2_match_sub(), NIOS2_NUM_REGS, NIOS2_RA_REGNUM, nios2_setup_default(), NIOS2_SP_REGNUM, NIOS2_STATUS_REGNUM, NIOS2_Z_REGNUM, offset, reg_value::offset, paddress(), read_memory_unsigned_integer(), reg_value::reg, nios2_unwind_cache::reg_saved, nios2_unwind_cache::reg_value, and nios2_unwind_cache::return_regnum.
Referenced by nios2_frame_unwind_cache(), and nios2_skip_prologue().
|
static |
Definition at line 1203 of file nios2-tdep.c.
References gdbarch_bfd_arch_info(), gdbarch_byte_order_for_code(), and NIOS2_OPCODE_SIZE.
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 1263 of file nios2-tdep.c.
References frame_id_build(), get_frame_pc(), get_frame_register_unsigned(), and NIOS2_SP_REGNUM.
Referenced by nios2_gdbarch_init().
Definition at line 148 of file nios2-tdep.c.
References _, nios2_dwarf2gdb_regno_map, NIOS2_NUM_REGS, and warning().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 208 of file nios2-tdep.c.
References gdb_assert, len, NIOS2_R2_REGNUM, NIOS2_R3_REGNUM, regcache_cooked_read(), register_size(), and TYPE_LENGTH.
Referenced by nios2_return_value().
|
static |
Definition at line 283 of file nios2-tdep.c.
References gdbarch_bfd_arch_info(), gdbarch_byte_order(), int, NIOS2_OPCODE_SIZE, and safe_read_memory_integer().
Referenced by nios2_analyze_prologue(), nios2_get_next_pc(), and nios2_in_epilogue_p().
Definition at line 1236 of file nios2-tdep.c.
References align_down().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 1451 of file nios2-tdep.c.
References nios2_unwind_cache::base, and nios2_frame_unwind_cache().
|
static |
Definition at line 1421 of file nios2-tdep.c.
References reg_saved::addr, reg_saved::basereg, nios2_unwind_cache::cfa, frame_unwind_got_constant(), frame_unwind_got_memory(), frame_unwind_got_register(), gdb_assert, nios2_frame_unwind_cache(), NIOS2_NUM_REGS, NIOS2_PC_REGNUM, NIOS2_SP_REGNUM, NIOS2_Z_REGNUM, nios2_unwind_cache::reg_saved, and nios2_unwind_cache::return_regnum.
|
static |
Definition at line 1405 of file nios2-tdep.c.
References nios2_unwind_cache::base, nios2_unwind_cache::cfa, frame_id_build(), nios2_frame_unwind_cache(), and nios2_unwind_cache::pc.
|
static |
Definition at line 1377 of file nios2-tdep.c.
References FRAME_OBSTACK_ZALLOC, get_frame_arch(), get_frame_func(), get_frame_pc(), nios2_analyze_prologue(), nios2_init_cache(), and nios2_unwind_cache::pc.
Referenced by nios2_frame_base_address(), nios2_frame_prev_register(), and nios2_frame_this_id().
|
static |
Definition at line 1695 of file nios2-tdep.c.
References core_addr_lessthan(), dwarf2_append_unwinders(), floatformats_ieee_double, floatformats_ieee_single, frame_base_set_default(), frame_unwind_append_unwinder(), gdbarch_list::gdbarch, gdbarch_alloc(), gdbarch_init_osabi(), gdbarch_list_lookup_by_info(), gdbarch_tdep::jb_pc, nios2_breakpoint_from_pc(), nios2_dummy_id(), nios2_dwarf_reg_to_regnum(), nios2_frame_align(), nios2_get_longjmp_target(), NIOS2_NUM_REGS, NIOS2_PC_REGNUM, nios2_print_insn(), nios2_push_dummy_call(), nios2_reg_names, nios2_register_name(), nios2_register_type(), nios2_return_value(), nios2_skip_prologue(), nios2_software_single_step(), NIOS2_SP_REGNUM, nios2_stack_frame_destroyed_p(), nios2_unwind_pc(), nios2_unwind_sp(), set_gdbarch_addr_bit(), set_gdbarch_breakpoint_from_pc(), set_gdbarch_double_bit(), set_gdbarch_double_format(), set_gdbarch_dummy_id(), set_gdbarch_dwarf2_reg_to_regnum(), set_gdbarch_float_bit(), set_gdbarch_float_format(), set_gdbarch_frame_align(), set_gdbarch_get_longjmp_target(), set_gdbarch_inner_than(), set_gdbarch_int_bit(), set_gdbarch_long_bit(), set_gdbarch_long_long_bit(), set_gdbarch_num_regs(), set_gdbarch_pc_regnum(), set_gdbarch_print_insn(), set_gdbarch_ptr_bit(), set_gdbarch_push_dummy_call(), set_gdbarch_register_name(), set_gdbarch_register_type(), set_gdbarch_return_value(), set_gdbarch_short_bit(), set_gdbarch_skip_prologue(), set_gdbarch_software_single_step(), set_gdbarch_sp_regnum(), set_gdbarch_stab_reg_to_regnum(), set_gdbarch_stack_frame_destroyed_p(), set_gdbarch_unwind_pc(), set_gdbarch_unwind_sp(), gdbarch_info::target_desc, tdesc_data, tdesc_data_alloc(), tdesc_data_cleanup(), tdesc_find_feature(), tdesc_has_registers(), tdesc_nios2, tdesc_numbered_register(), tdesc_use_registers(), and xcalloc().
Referenced by _initialize_nios2_tdep().
|
static |
Definition at line 1677 of file nios2-tdep.c.
References extract_unsigned_integer(), gdbarch_byte_order(), gdbarch_tdep(), get_frame_arch(), get_frame_register_unsigned(), gdbarch_tdep::jb_pc, NIOS2_R4_REGNUM, and target_read_memory().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 1580 of file nios2-tdep.c.
References branch_eq, branch_ge, branch_geu, branch_lt, branch_ltu, branch_ne, branch_none, gdbarch_bfd_arch_info(), gdbarch_tdep(), get_frame_arch(), get_frame_register_signed(), get_frame_register_unsigned(), nios2_fetch_insn(), nios2_match_branch(), nios2_match_calli(), nios2_match_callr(), nios2_match_jmpi(), nios2_match_jmpr(), nios2_match_trap(), NIOS2_OPCODE_SIZE, and gdbarch_tdep::syscall_next_pc.
Referenced by nios2_software_single_step().
|
static |
Definition at line 587 of file nios2-tdep.c.
References branch_none, gdbarch_bfd_arch_info(), nios2_fetch_insn(), nios2_match_add(), nios2_match_addi(), nios2_match_branch(), nios2_match_jmpi(), nios2_match_jmpr(), nios2_match_ldw(), NIOS2_OPCODE_SIZE, and NIOS2_SP_REGNUM.
Referenced by nios2_analyze_prologue(), and nios2_stack_frame_destroyed_p().
|
static |
Definition at line 269 of file nios2-tdep.c.
References nios2_unwind_cache::base, nios2_unwind_cache::cfa, NIOS2_RA_REGNUM, nios2_setup_default(), nios2_unwind_cache::pc, and nios2_unwind_cache::return_regnum.
Referenced by nios2_frame_unwind_cache(), and nios2_skip_prologue().
|
static |
Definition at line 305 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue(), and nios2_in_epilogue_p().
|
static |
Definition at line 340 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue(), and nios2_in_epilogue_p().
|
static |
Definition at line 439 of file nios2-tdep.c.
References branch_eq, branch_ge, branch_geu, branch_lt, branch_ltu, branch_ne, and branch_none.
Referenced by nios2_analyze_prologue(), nios2_get_next_pc(), and nios2_in_epilogue_p().
|
static |
Definition at line 553 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue().
|
static |
Definition at line 496 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue(), and nios2_get_next_pc().
|
static |
Definition at line 538 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue(), and nios2_get_next_pc().
|
static |
Definition at line 480 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue(), nios2_get_next_pc(), and nios2_in_epilogue_p().
|
static |
Definition at line 512 of file nios2-tdep.c.
References NIOS2_BA_REGNUM, NIOS2_EA_REGNUM, and NIOS2_RA_REGNUM.
Referenced by nios2_analyze_prologue(), nios2_get_next_pc(), and nios2_in_epilogue_p().
|
static |
Definition at line 394 of file nios2-tdep.c.
Referenced by nios2_in_epilogue_p().
|
static |
Definition at line 358 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue().
|
static |
Definition at line 411 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue().
|
static |
Definition at line 376 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue().
|
static |
Definition at line 322 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue().
|
static |
Definition at line 568 of file nios2-tdep.c.
Referenced by nios2_get_next_pc().
|
static |
Definition at line 1224 of file nios2-tdep.c.
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 1273 of file nios2-tdep.c.
References align_up(), check_typedef(), extract_unsigned_integer(), find_function_addr(), gdbarch_byte_order(), len, MAX_REGISTER_SIZE, NIOS2_FIRST_ARGREG, NIOS2_LAST_ARGREG, NIOS2_RA_REGNUM, NIOS2_SP_REGNUM, regcache_cooked_write_signed(), regcache_cooked_write_unsigned(), TYPE_CODE, TYPE_LENGTH, value_contents(), value_type(), and write_memory().
Referenced by nios2_gdbarch_init().
Definition at line 177 of file nios2-tdep.c.
References NIOS2_NUM_REGS, nios2_reg_names, and tdesc_register_name().
Referenced by nios2_gdbarch_init().
Definition at line 189 of file nios2-tdep.c.
References builtin_type::builtin_data_ptr, builtin_type::builtin_func_ptr, builtin_type(), builtin_type::builtin_uint32, gdbarch_target_desc(), NIOS2_PC_REGNUM, NIOS2_SP_REGNUM, tdesc_has_registers(), and tdesc_register_type().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 1245 of file nios2-tdep.c.
References nios2_extract_return_value(), nios2_store_return_value(), RETURN_VALUE_REGISTER_CONVENTION, RETURN_VALUE_STRUCT_CONVENTION, and TYPE_LENGTH.
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 250 of file nios2-tdep.c.
References reg_saved::addr, reg_saved::basereg, NIOS2_NUM_REGS, reg_value::offset, reg_value::reg, nios2_unwind_cache::reg_saved, and nios2_unwind_cache::reg_value.
Referenced by nios2_analyze_prologue(), and nios2_init_cache().
Definition at line 1169 of file nios2-tdep.c.
References find_pc_partial_function(), max, nios2_analyze_prologue(), nios2_init_cache(), and skip_prologue_using_sal().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 1663 of file nios2-tdep.c.
References get_frame_address_space(), get_frame_arch(), get_frame_pc(), insert_single_step_breakpoint(), and nios2_get_next_pc().
Referenced by nios2_gdbarch_init().
Definition at line 664 of file nios2-tdep.c.
References find_pc_partial_function(), and nios2_in_epilogue_p().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 229 of file nios2-tdep.c.
References gdb_assert, len, NIOS2_R2_REGNUM, NIOS2_R3_REGNUM, regcache_cooked_write(), register_size(), and TYPE_LENGTH.
Referenced by nios2_return_value().
|
static |
Definition at line 1484 of file nios2-tdep.c.
References find_pc_partial_function(), frame_id_build(), gdbarch_num_regs(), gdbarch_pc_regnum(), get_frame_arch(), get_frame_pc(), get_frame_register_unsigned(), NIOS2_RA_REGNUM, NIOS2_SP_REGNUM, gdbarch::num_regs, trad_frame_cache_zalloc(), trad_frame_set_id(), trad_frame_set_reg_realreg(), and trad_frame_set_this_base().
Referenced by nios2_stub_frame_prev_register(), and nios2_stub_frame_this_id().
|
static |
Definition at line 1530 of file nios2-tdep.c.
References nios2_stub_frame_cache(), and trad_frame_get_register().
|
static |
Definition at line 1545 of file nios2-tdep.c.
References dummy, get_frame_address_in_block(), get_frame_pc(), in_plt_section(), and target_read_memory().
|
static |
Definition at line 1518 of file nios2-tdep.c.
References nios2_stub_frame_cache(), and trad_frame_get_id().
|
static |
Definition at line 1356 of file nios2-tdep.c.
References extract_typed_address(), frame_unwind_register(), and NIOS2_PC_REGNUM.
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 1367 of file nios2-tdep.c.
References frame_unwind_register_unsigned(), and NIOS2_SP_REGNUM.
Referenced by nios2_gdbarch_init().
initialize_file_ftype _initialize_nios2_tdep |
|
static |
Definition at line 58 of file nios2-tdep.c.
Referenced by _initialize_nios2_tdep(), and nios2_analyze_prologue().
|
static |
Definition at line 110 of file nios2-tdep.c.
Referenced by nios2_dwarf_reg_to_regnum().
|
static |
Definition at line 1472 of file nios2-tdep.c.
|
static |
Definition at line 1462 of file nios2-tdep.c.
|
static |
Definition at line 161 of file nios2-tdep.c.
Referenced by nios2_gdbarch_init(), and nios2_register_name().
|
static |
Definition at line 1564 of file nios2-tdep.c.