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 "infcall.h"
#include "regset.h"
#include "target-descriptions.h"
#include "objfiles.h"
#include <algorithm>
#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 | |
gdb_static_assert (ARRAY_SIZE(nios2_dwarf2gdb_regno_map)==NIOS2_NUM_REGS) | |
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_stwm (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *reglist, int *ra, int *imm, int *wb, int *id) |
static int | nios2_match_ldwm (uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *reglist, int *ra, int *imm, int *wb, int *id, int *ret) |
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, frame_info_ptr this_frame) |
static CORE_ADDR | nios2_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) |
static int | nios2_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr) |
static const gdb_byte * | nios2_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size) |
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 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, function_call_return_method return_method, CORE_ADDR struct_addr) |
static CORE_ADDR | nios2_unwind_pc (struct gdbarch *gdbarch, frame_info_ptr next_frame) |
static struct nios2_unwind_cache * | nios2_frame_unwind_cache (frame_info_ptr this_frame, void **this_prologue_cache) |
static void | nios2_frame_this_id (frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id) |
static struct value * | nios2_frame_prev_register (frame_info_ptr this_frame, void **this_cache, int regnum) |
static CORE_ADDR | nios2_frame_base_address (frame_info_ptr this_frame, void **this_cache) |
static struct trad_frame_cache * | nios2_stub_frame_cache (frame_info_ptr this_frame, void **this_cache) |
static void | nios2_stub_frame_this_id (frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id) |
static struct value * | nios2_stub_frame_prev_register (frame_info_ptr this_frame, void **this_cache, int regnum) |
static int | nios2_stub_frame_sniffer (const struct frame_unwind *self, frame_info_ptr this_frame, void **cache) |
static CORE_ADDR | nios2_get_next_pc (struct regcache *regcache, CORE_ADDR pc) |
static std::vector< CORE_ADDR > | nios2_software_single_step (struct regcache *regcache) |
static int | nios2_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc) |
static ULONGEST | nios2_type_align (struct gdbarch *gdbarch, struct type *type) |
static std::string | nios2_gcc_target_options (struct gdbarch *gdbarch) |
static struct gdbarch * | nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) |
void | _initialize_nios2_tdep () |
Variables | |
static bool | nios2_debug = false |
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 |
enum branch_condition |
Enumerator | |
---|---|
branch_none | |
branch_eq | |
branch_ne | |
branch_ge | |
branch_geu | |
branch_lt | |
branch_ltu |
Definition at line 705 of file nios2-tdep.c.
void _initialize_nios2_tdep | ( | ) |
Definition at line 2393 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.
gdb_static_assert | ( | ARRAY_SIZE(nios2_dwarf2gdb_regno_map) | = =NIOS2_NUM_REGS | ) |
|
static |
Definition at line 1189 of file nios2-tdep.c.
References reg_saved::addr, nios2_unwind_cache::base, reg_saved::basereg, branch_geu, branch_ltu, nios2_unwind_cache::cfa, frame_relative_level(), gdb_printf(), 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_ldwm(), nios2_match_orhi(), nios2_match_rdctl(), nios2_match_stw(), nios2_match_stwm(), nios2_match_sub(), nios2_match_trap(), NIOS2_NUM_REGS, NIOS2_RA_REGNUM, nios2_setup_default(), NIOS2_SP_REGNUM, NIOS2_STATUS_REGNUM, NIOS2_Z_REGNUM, reg_value::offset, value::offset(), paddress(), read_memory_unsigned_integer(), reg_value::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 1698 of file nios2-tdep.c.
References gdbarch_bfd_arch_info(), NIOS2_CDX_OPCODE_SIZE, nios2_fetch_insn(), and NIOS2_OPCODE_SIZE.
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 148 of file nios2-tdep.c.
References nios2_dwarf2gdb_regno_map, and NIOS2_NUM_REGS.
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 205 of file nios2-tdep.c.
References readable_regcache::cooked_read(), type::length(), NIOS2_R2_REGNUM, NIOS2_R3_REGNUM, and register_size().
Referenced by nios2_return_value().
|
static |
Definition at line 280 of file nios2-tdep.c.
References gdbarch_bfd_arch_info(), gdbarch_byte_order(), NIOS2_CDX_OPCODE_SIZE, NIOS2_OPCODE_SIZE, and safe_read_memory_integer().
Referenced by nios2_analyze_prologue(), nios2_breakpoint_kind_from_pc(), nios2_get_next_pc(), and nios2_in_epilogue_p().
|
static |
Definition at line 1776 of file nios2-tdep.c.
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 1969 of file nios2-tdep.c.
References nios2_frame_unwind_cache().
|
static |
Definition at line 1939 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(), nios2_frame_unwind_cache(), NIOS2_NUM_REGS, NIOS2_PC_REGNUM, NIOS2_SP_REGNUM, NIOS2_Z_REGNUM, nios2_unwind_cache::reg_saved, regnum, and nios2_unwind_cache::return_regnum.
|
static |
Definition at line 1923 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 1896 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 2266 of file nios2-tdep.c.
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 2275 of file nios2-tdep.c.
References arches, core_addr_lessthan(), dwarf2_append_unwinders(), floatformats_ieee_double, floatformats_ieee_single, frame_base_set_default(), frame_unwind_append_unwinder(), gdbarch_alloc(), gdbarch_init_osabi(), gdbarch_list_lookup_by_info(), registry< T >::get(), nios2_gdbarch_tdep::jb_pc, nios2_breakpoint_kind_from_pc(), nios2_dwarf_reg_to_regnum(), nios2_frame_align(), nios2_frame_base, nios2_frame_unwind, nios2_gcc_target_options(), nios2_get_longjmp_target(), NIOS2_NUM_REGS, NIOS2_PC_REGNUM, 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_stub_frame_unwind, nios2_sw_breakpoint_from_kind(), nios2_type_align(), nios2_unwind_pc(), set_gdbarch_addr_bit(), set_gdbarch_breakpoint_kind_from_pc(), set_gdbarch_double_bit(), set_gdbarch_double_format(), set_gdbarch_dwarf2_reg_to_regnum(), set_gdbarch_float_bit(), set_gdbarch_float_format(), set_gdbarch_frame_align(), set_gdbarch_gcc_target_options(), 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_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_sw_breakpoint_from_kind(), set_gdbarch_type_align(), set_gdbarch_unwind_pc(), tdesc_data, tdesc_data_alloc(), tdesc_find_feature(), tdesc_has_registers(), tdesc_nios2, tdesc_numbered_register(), and tdesc_use_registers().
Referenced by _initialize_nios2_tdep().
|
static |
Definition at line 2221 of file nios2-tdep.c.
References extract_unsigned_integer(), gdbarch_byte_order(), get_frame_arch(), get_frame_register_unsigned(), nios2_gdbarch_tdep::jb_pc, NIOS2_R4_REGNUM, and target_read_memory().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 2098 of file nios2-tdep.c.
References reg_buffer::arch(), branch_eq, branch_ge, branch_geu, branch_lt, branch_ltu, branch_ne, branch_none, gdbarch_bfd_arch_info(), get_current_frame(), nios2_gdbarch_tdep::is_kernel_helper, nios2_fetch_insn(), nios2_match_branch(), nios2_match_calli(), nios2_match_callr(), nios2_match_jmpi(), nios2_match_jmpr(), nios2_match_ldwm(), nios2_match_trap(), NIOS2_OPCODE_SIZE, NIOS2_RA_REGNUM, nios2_unwind_pc(), regcache_raw_get_signed(), and nios2_gdbarch_tdep::syscall_next_pc.
Referenced by nios2_software_single_step().
|
static |
Definition at line 1007 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_match_ldwm(), NIOS2_OPCODE_SIZE, and NIOS2_SP_REGNUM.
Referenced by nios2_analyze_prologue(), and nios2_stack_frame_destroyed_p().
|
static |
Definition at line 266 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 310 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue(), and nios2_in_epilogue_p().
|
static |
Definition at line 388 of file nios2-tdep.c.
References NIOS2_SP_REGNUM.
Referenced by nios2_analyze_prologue(), and nios2_in_epilogue_p().
|
static |
Definition at line 716 of file nios2-tdep.c.
References branch_eq, branch_ge, branch_geu, branch_lt, branch_ltu, branch_ne, branch_none, and NIOS2_Z_REGNUM.
Referenced by nios2_analyze_prologue(), nios2_get_next_pc(), and nios2_in_epilogue_p().
|
static |
Definition at line 945 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue().
|
static |
Definition at line 839 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue(), and nios2_get_next_pc().
|
static |
Definition at line 916 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue(), and nios2_get_next_pc().
|
static |
Definition at line 814 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue(), nios2_get_next_pc(), and nios2_in_epilogue_p().
|
static |
Definition at line 864 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 528 of file nios2-tdep.c.
References NIOS2_SP_REGNUM.
Referenced by nios2_in_epilogue_p().
|
static |
Definition at line 653 of file nios2-tdep.c.
References NIOS2_SP_REGNUM.
Referenced by nios2_analyze_prologue(), nios2_get_next_pc(), and nios2_in_epilogue_p().
|
static |
Definition at line 442 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue().
|
static |
Definition at line 577 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue().
|
static |
Definition at line 471 of file nios2-tdep.c.
References NIOS2_SP_REGNUM.
Referenced by nios2_analyze_prologue().
|
static |
Definition at line 603 of file nios2-tdep.c.
References NIOS2_SP_REGNUM.
Referenced by nios2_analyze_prologue().
|
static |
Definition at line 352 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue().
|
static |
Definition at line 974 of file nios2-tdep.c.
Referenced by nios2_analyze_prologue(), and nios2_get_next_pc().
|
static |
Definition at line 1803 of file nios2-tdep.c.
References check_typedef(), value::contents(), extract_unsigned_integer(), gdbarch_byte_order(), type::length(), NIOS2_FIRST_ARGREG, NIOS2_LAST_ARGREG, NIOS2_RA_REGNUM, NIOS2_SP_REGNUM, regcache_cooked_write_signed(), regcache_cooked_write_unsigned(), return_method_struct, value::type(), and write_memory().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 174 of file nios2-tdep.c.
References NIOS2_NUM_REGS, nios2_reg_names, and tdesc_register_name().
Referenced by nios2_gdbarch_init().
Definition at line 186 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 1785 of file nios2-tdep.c.
References type::length(), nios2_extract_return_value(), nios2_store_return_value(), RETURN_VALUE_REGISTER_CONVENTION, and RETURN_VALUE_STRUCT_CONVENTION.
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 247 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().
|
static |
Definition at line 1672 of file nios2-tdep.c.
References find_pc_partial_function(), nios2_analyze_prologue(), nios2_init_cache(), and skip_prologue_using_sal().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 2211 of file nios2-tdep.c.
References nios2_get_next_pc(), and regcache_read_pc().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 1116 of file nios2-tdep.c.
References find_pc_partial_function(), and nios2_in_epilogue_p().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 226 of file nios2-tdep.c.
References regcache::cooked_write(), type::length(), NIOS2_R2_REGNUM, NIOS2_R3_REGNUM, and register_size().
Referenced by nios2_return_value().
|
static |
Definition at line 2003 of file nios2-tdep.c.
References find_pc_partial_function(), frame_id_build(), gdbarch_pc_regnum(), get_frame_arch(), get_frame_pc(), get_frame_register_unsigned(), NIOS2_RA_REGNUM, NIOS2_SP_REGNUM, 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 2048 of file nios2-tdep.c.
References nios2_stub_frame_cache(), regnum, trad_frame_cache::this_frame, and trad_frame_get_register().
|
static |
Definition at line 2063 of file nios2-tdep.c.
References dummy, get_frame_address_in_block(), get_frame_pc(), in_plt_section(), target_read_memory(), and trad_frame_cache::this_frame.
|
static |
Definition at line 2036 of file nios2-tdep.c.
References nios2_stub_frame_cache(), trad_frame_cache::this_frame, trad_frame_cache::this_id, and trad_frame_get_id().
|
static |
Definition at line 1720 of file nios2-tdep.c.
References gdbarch_bfd_arch_info(), gdbarch_byte_order_for_code(), NIOS2_CDX_OPCODE_SIZE, and size.
Referenced by nios2_gdbarch_init().
Definition at line 2239 of file nios2-tdep.c.
References check_typedef(), type::code(), and type::length().
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 1883 of file nios2-tdep.c.
References extract_typed_address(), frame_unwind_register(), and NIOS2_PC_REGNUM.
Referenced by nios2_gdbarch_init(), and nios2_get_next_pc().
|
static |
Definition at line 55 of file nios2-tdep.c.
Referenced by _initialize_nios2_tdep(), and nios2_analyze_prologue().
|
static |
Definition at line 109 of file nios2-tdep.c.
Referenced by nios2_dwarf_reg_to_regnum().
|
static |
Definition at line 1991 of file nios2-tdep.c.
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 1980 of file nios2-tdep.c.
Referenced by nios2_gdbarch_init().
|
static |
Definition at line 158 of file nios2-tdep.c.
Referenced by nios2_gdbarch_init(), and nios2_register_name().
|
static |
Definition at line 2081 of file nios2-tdep.c.
Referenced by nios2_gdbarch_init().