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 "gdb_assert.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.
void _initialize_nios2_tdep | ( | void | ) |
Definition at line 1624 of file nios2-tdep.c.
References _, _initialize_nios2_tdep, add_setshow_boolean_cmd(), class_maintenance, gdbarch_register(), initialize_tdesc_nios2(), nios2_debug, nios2_gdbarch_init(), setdebuglist, and showdebuglist.
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] |
Definition at line 468 of file nios2-tdep.c.
References reg_saved::addr, nios2_unwind_cache::base, reg_saved::basereg, nios2_unwind_cache::cfa, fprintf_unfiltered(), frame_relative_level(), gdb_stdlog, gdbarch_byte_order(), get_frame_register_unsigned(), memcpy(), nios2_debug, NIOS2_EA_REGNUM, NIOS2_ESTATUS_REGNUM, NIOS2_FP_REGNUM, NIOS2_GP_REGNUM, nios2_in_epilogue_p(), nios2_match_sequence(), NIOS2_NUM_REGS, NIOS2_OPCODE_SIZE, 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 const gdb_byte* nios2_breakpoint_from_pc | ( | struct gdbarch * | gdbarch, |
CORE_ADDR * | bp_addr, | ||
int * | bp_size | ||
) | [static] |
Definition at line 972 of file nios2-tdep.c.
References gdbarch_byte_order_for_code().
Referenced by nios2_gdbarch_init().
static struct frame_id nios2_dummy_id | ( | struct gdbarch * | gdbarch, |
struct frame_info * | this_frame | ||
) | [static, read] |
Definition at line 1034 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().
static int nios2_dwarf_reg_to_regnum | ( | struct gdbarch * | gdbarch, |
int | dw_reg | ||
) | [static] |
Definition at line 149 of file nios2-tdep.c.
References _, nios2_dwarf2gdb_regno_map, NIOS2_NUM_REGS, and warning().
Referenced by nios2_gdbarch_init().
static void nios2_extract_return_value | ( | struct gdbarch * | gdbarch, |
struct type * | valtype, | ||
struct regcache * | regcache, | ||
gdb_byte * | valbuf | ||
) | [static] |
Definition at line 209 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 unsigned long nios2_fetch_instruction | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | pc | ||
) | [static] |
Definition at line 1368 of file nios2-tdep.c.
References gdbarch_byte_order(), NIOS2_OPCODE_SIZE, and read_memory_unsigned_integer().
Referenced by nios2_get_next_pc().
static CORE_ADDR nios2_frame_align | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | addr | ||
) | [static] |
Definition at line 1007 of file nios2-tdep.c.
References align_down().
Referenced by nios2_gdbarch_init().
static CORE_ADDR nios2_frame_base_address | ( | struct frame_info * | this_frame, |
void ** | this_cache | ||
) | [static] |
Definition at line 1222 of file nios2-tdep.c.
References nios2_unwind_cache::base, and nios2_frame_unwind_cache().
static struct value* nios2_frame_prev_register | ( | struct frame_info * | this_frame, |
void ** | this_cache, | ||
int | regnum | ||
) | [static, read] |
Definition at line 1192 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 void nios2_frame_this_id | ( | struct frame_info * | this_frame, |
void ** | this_cache, | ||
struct frame_id * | this_id | ||
) | [static] |
Definition at line 1176 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 struct nios2_unwind_cache* nios2_frame_unwind_cache | ( | struct frame_info * | this_frame, |
void ** | this_prologue_cache | ||
) | [static, read] |
Definition at line 1148 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 struct gdbarch* nios2_gdbarch_init | ( | struct gdbarch_info | info, |
struct gdbarch_list * | arches | ||
) | [static, read] |
Definition at line 1503 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_in_function_epilogue_p(), 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_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_in_function_epilogue_p(), 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_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 int nios2_get_longjmp_target | ( | struct frame_info * | frame, |
CORE_ADDR * | pc | ||
) | [static] |
Definition at line 1485 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 CORE_ADDR nios2_get_next_pc | ( | struct frame_info * | frame, |
CORE_ADDR | pc | ||
) | [static] |
Definition at line 1379 of file nios2-tdep.c.
References gdbarch_tdep(), get_frame_arch(), get_frame_register_signed(), get_frame_register_unsigned(), nios2_fetch_instruction(), NIOS2_OPCODE_SIZE, gdbarch_tdep::pc, and gdbarch_tdep::syscall_next_pc.
Referenced by nios2_software_single_step().
static int nios2_in_epilogue_p | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | current_pc, | ||
CORE_ADDR | start_pc | ||
) | [static] |
Definition at line 287 of file nios2-tdep.c.
References gdbarch_byte_order(), NIOS2_OPCODE_SIZE, and read_memory_unsigned_integer().
Referenced by nios2_analyze_prologue(), and nios2_in_function_epilogue_p().
static int nios2_in_function_epilogue_p | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | pc | ||
) | [static] |
Definition at line 325 of file nios2-tdep.c.
References find_pc_partial_function(), and nios2_in_epilogue_p().
Referenced by nios2_gdbarch_init().
static void nios2_init_cache | ( | struct nios2_unwind_cache * | cache, |
CORE_ADDR | pc | ||
) | [static] |
Definition at line 270 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 int nios2_match_sequence | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | start_pc, | ||
const wild_insn * | sequence, | ||
int | count | ||
) | [static] |
Definition at line 367 of file nios2-tdep.c.
References gdbarch_byte_order(), NIOS2_OPCODE_SIZE, and read_memory_unsigned_integer().
Referenced by nios2_analyze_prologue().
static int nios2_print_insn | ( | bfd_vma | memaddr, |
disassemble_info * | info | ||
) | [static] |
Definition at line 995 of file nios2-tdep.c.
Referenced by nios2_gdbarch_init().
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] |
Definition at line 1044 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().
static const char* nios2_register_name | ( | struct gdbarch * | gdbarch, |
int | regno | ||
) | [static] |
Definition at line 178 of file nios2-tdep.c.
References NIOS2_NUM_REGS, nios2_reg_names, and tdesc_register_name().
Referenced by nios2_gdbarch_init().
static struct type* nios2_register_type | ( | struct gdbarch * | gdbarch, |
int | regno | ||
) | [static, read] |
Definition at line 190 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 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] |
Definition at line 1016 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 void nios2_setup_default | ( | struct nios2_unwind_cache * | cache | ) | [static] |
Definition at line 251 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 CORE_ADDR nios2_skip_prologue | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | start_pc | ||
) | [static] |
Definition at line 945 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 int nios2_software_single_step | ( | struct frame_info * | frame | ) | [static] |
Definition at line 1471 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().
static void nios2_store_return_value | ( | struct gdbarch * | gdbarch, |
struct type * | valtype, | ||
struct regcache * | regcache, | ||
const gdb_byte * | valbuf | ||
) | [static] |
Definition at line 230 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 CORE_ADDR nios2_stub_frame_base_address | ( | struct frame_info * | this_frame, |
void ** | this_cache | ||
) | [static] |
Definition at line 1337 of file nios2-tdep.c.
References nios2_stub_frame_cache(), and trad_frame_get_this_base().
static struct trad_frame_cache* nios2_stub_frame_cache | ( | struct frame_info * | this_frame, |
void ** | this_cache | ||
) | [static, read] |
Definition at line 1255 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_base_address(), nios2_stub_frame_prev_register(), and nios2_stub_frame_this_id().
static struct value* nios2_stub_frame_prev_register | ( | struct frame_info * | this_frame, |
void ** | this_cache, | ||
int | regnum | ||
) | [static, read] |
Definition at line 1301 of file nios2-tdep.c.
References nios2_stub_frame_cache(), and trad_frame_get_register().
static int nios2_stub_frame_sniffer | ( | const struct frame_unwind * | self, |
struct frame_info * | this_frame, | ||
void ** | cache | ||
) | [static] |
Definition at line 1316 of file nios2-tdep.c.
References dummy, get_frame_address_in_block(), get_frame_pc(), in_plt_section(), and target_read_memory().
static void nios2_stub_frame_this_id | ( | struct frame_info * | this_frame, |
void ** | this_cache, | ||
struct frame_id * | this_id | ||
) | [static] |
Definition at line 1289 of file nios2-tdep.c.
References nios2_stub_frame_cache(), and trad_frame_get_id().
static CORE_ADDR nios2_unwind_pc | ( | struct gdbarch * | gdbarch, |
struct frame_info * | next_frame | ||
) | [static] |
Definition at line 1127 of file nios2-tdep.c.
References extract_typed_address(), frame_unwind_register(), and NIOS2_PC_REGNUM.
Referenced by nios2_gdbarch_init().
static CORE_ADDR nios2_unwind_sp | ( | struct gdbarch * | gdbarch, |
struct frame_info * | this_frame | ||
) | [static] |
Definition at line 1138 of file nios2-tdep.c.
References frame_unwind_register_unsigned(), and NIOS2_SP_REGNUM.
Referenced by nios2_gdbarch_init().
Referenced by _initialize_nios2_tdep(), and initialize_all_files().
const wild_insn irqentry_insn[] [static] |
{ { 0x0031307a, 0x00000000 }, { 0xc600004c, 0x00000000 }, { 0xc0000026, 0x003fffc0 }, { 0x0031313a, 0x00000000 }, { 0xc0000026, 0x003fffc0 } }
Definition at line 354 of file nios2-tdep.c.
int nios2_debug = 0 [static] |
Definition at line 59 of file nios2-tdep.c.
Referenced by _initialize_nios2_tdep(), and nios2_analyze_prologue().
int nios2_dwarf2gdb_regno_map[] [static] |
Definition at line 111 of file nios2-tdep.c.
Referenced by nios2_dwarf_reg_to_regnum().
struct frame_base nios2_frame_base [static] |
{ &nios2_frame_unwind, nios2_frame_base_address, nios2_frame_base_address, nios2_frame_base_address }
Definition at line 1243 of file nios2-tdep.c.
struct frame_unwind nios2_frame_unwind [static] |
{ NORMAL_FRAME, default_frame_unwind_stop_reason, nios2_frame_this_id, nios2_frame_prev_register, NULL, default_frame_sniffer }
Definition at line 1233 of file nios2-tdep.c.
const char* const nios2_reg_names[NIOS2_NUM_REGS] [static] |
{ "zero", "at", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", "et", "bt", "gp", "sp", "fp", "ea", "ba", "ra", "pc", "status", "estatus", "bstatus", "ienable", "ipending", "cpuid", "ctl6", "exception", "pteaddr", "tlbacc", "tlbmisc", "eccinj", "badaddr", "config", "mpubase", "mpuacc" }
Definition at line 162 of file nios2-tdep.c.
Referenced by nios2_gdbarch_init(), and nios2_register_name().
struct frame_base nios2_stub_frame_base [static] |
{ &nios2_stub_frame_unwind, nios2_stub_frame_base_address, nios2_stub_frame_base_address, nios2_stub_frame_base_address }
Definition at line 1357 of file nios2-tdep.c.
struct frame_unwind nios2_stub_frame_unwind [static] |
{ NORMAL_FRAME, default_frame_unwind_stop_reason, nios2_stub_frame_this_id, nios2_stub_frame_prev_register, NULL, nios2_stub_frame_sniffer }
Definition at line 1347 of file nios2-tdep.c.
const wild_insn profiler_insn[] [static] |
{ { 0x0010e03a, 0x00000000 }, { 0xf813883a, 0x00000000 }, { 0x02800034, 0x003fffc0 }, { 0x52800004, 0x003fffc0 }, { 0x00000000, 0xffffffc0 }, { 0x483f883a, 0x00000000 } }
Definition at line 344 of file nios2-tdep.c.