GDB (xrefs)

Classes | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/nios2-tdep.c File Reference
`#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, struct frame_info *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 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 regcache *regcache, CORE_ADDR pc)
static std::vector< CORE_ADDR > | nios2_software_single_step (struct regcache *regcache)
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

## Enumeration Type Documentation

## ◆ branch_condition

enum branch_condition

Enumerator
branch_none |
branch_eq |
branch_ne |
branch_ge |
branch_geu |
branch_lt |
branch_ltu |

Definition at line 703 of file nios2-tdep.c.

## Function Documentation

## ◆ _initialize_nios2_tdep()

void _initialize_nios2_tdep | ( | void |  | ) |

Definition at line 2355 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()

gdb_static_assert | ( | ARRAY_SIZE(nios2_dwarf2gdb_regno_map) | = `=NIOS2_NUM_REGS` | ) |

## ◆ nios2_analyze_prologue()

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 1187 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_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, offset, 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().

## ◆ nios2_breakpoint_kind_from_pc()

static int nios2_breakpoint_kind_from_pc | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR * | pcptr
| ) |  |
| static

Definition at line 1699 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().

## ◆ nios2_dummy_id()

static struct frame_id nios2_dummy_id | ( | struct gdbarch * | gdbarch,
|  | struct frame_info * | this_frame
| ) |  |
| static

Definition at line 1804 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().

## ◆ nios2_dwarf_reg_to_regnum()

static int nios2_dwarf_reg_to_regnum | ( | struct gdbarch * | gdbarch,
|  | int | dw_reg
| ) |  |
| static

Definition at line 146 of file nios2-tdep.c.

References nios2_dwarf2gdb_regno_map, and NIOS2_NUM_REGS.

Referenced by nios2_gdbarch_init().

## ◆ nios2_extract_return_value()

static void nios2_extract_return_value | ( | struct gdbarch * | gdbarch,
|  | struct type * | valtype,
|  | struct regcache * | regcache,
|  | gdb_byte * | valbuf
| ) |  |
| static

Definition at line 203 of file nios2-tdep.c.

References gdb_assert, NIOS2_R2_REGNUM, NIOS2_R3_REGNUM, regcache_cooked_read(), register_size(), and TYPE_LENGTH.

Referenced by nios2_return_value().

## ◆ nios2_fetch_insn()

static const struct nios2_opcode* nios2_fetch_insn | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | pc,
|  | unsigned int * | insnp
| ) |  |
| static

Definition at line 278 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().

## ◆ nios2_frame_align()

static CORE_ADDR nios2_frame_align | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 1777 of file nios2-tdep.c.

References align_down().

Referenced by nios2_gdbarch_init().

## ◆ nios2_frame_base_address()

static CORE_ADDR nios2_frame_base_address | ( | struct frame_info * | this_frame,
|  | void ** | this_cache
| ) |  |
| static

Definition at line 1988 of file nios2-tdep.c.

References nios2_unwind_cache::base, and nios2_frame_unwind_cache().

## ◆ nios2_frame_prev_register()

static struct value* nios2_frame_prev_register | ( | struct frame_info * | this_frame,
|  | void ** | this_cache,
|  | int | regnum
| ) |  |
| static

Definition at line 1958 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, regnum, and nios2_unwind_cache::return_regnum.

## ◆ nios2_frame_this_id()

static void nios2_frame_this_id | ( | struct frame_info * | this_frame,
|  | void ** | this_cache,
|  | struct frame_id * | this_id
| ) |  |
| static

Definition at line 1942 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.

## ◆ nios2_frame_unwind_cache()

static struct nios2_unwind_cache* nios2_frame_unwind_cache | ( | struct frame_info * | this_frame,
|  | void ** | this_prologue_cache
| ) |  |
| static

Definition at line 1915 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().

## ◆ nios2_gdbarch_init()

static struct gdbarch* nios2_gdbarch_init | ( | struct gdbarch_info | info,
|  | struct gdbarch_list * | arches
| ) |  |
| static

Definition at line 2237 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_kind_from_pc(), nios2_dummy_id(), nios2_dwarf_reg_to_regnum(), nios2_frame_align(), nios2_frame_base, nios2_frame_unwind, 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_unwind_pc(), nios2_unwind_sp(), set_gdbarch_addr_bit(), set_gdbarch_breakpoint_kind_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_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_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 XCNEW.

Referenced by _initialize_nios2_tdep().

## ◆ nios2_get_longjmp_target()

static int nios2_get_longjmp_target | ( | struct frame_info * | frame,
|  | CORE_ADDR * | pc
| ) |  |
| static

Definition at line 2219 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, gdbarch_tdep::pc, and target_read_memory().

Referenced by nios2_gdbarch_init().

## ◆ nios2_get_next_pc()

static CORE_ADDR nios2_get_next_pc | ( | struct regcache * | regcache,
|  | CORE_ADDR | pc
| ) |  |
| static

Definition at line 2115 of file nios2-tdep.c.

References regcache::arch(), branch_eq, branch_ge, branch_geu, branch_lt, branch_ltu, branch_ne, branch_none, gdbarch_bfd_arch_info(), gdbarch_tdep(), get_current_frame(), 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(), regcache_raw_get_unsigned(), and gdbarch_tdep::syscall_next_pc.

Referenced by nios2_software_single_step().

## ◆ nios2_in_epilogue_p()

static int nios2_in_epilogue_p | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | current_pc,
|  | CORE_ADDR | start_pc
| ) |  |
| static

Definition at line 1005 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().

## ◆ nios2_init_cache()

static void nios2_init_cache | ( | struct nios2_unwind_cache * | cache,
|  | CORE_ADDR | pc
| ) |  |
| static

Definition at line 264 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().

## ◆ nios2_match_add()

static int nios2_match_add | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | int * | ra,
|  | int * | rb,
|  | int * | rc
| ) |  |
| static

Definition at line 308 of file nios2-tdep.c.

Referenced by nios2_analyze_prologue(), and nios2_in_epilogue_p().

## ◆ nios2_match_addi()

static int nios2_match_addi | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | int * | ra,
|  | int * | rb,
|  | int * | imm
| ) |  |
| static

Definition at line 386 of file nios2-tdep.c.

References NIOS2_SP_REGNUM.

Referenced by nios2_analyze_prologue(), and nios2_in_epilogue_p().

## ◆ nios2_match_branch()

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

Definition at line 714 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().

## ◆ nios2_match_break()

static int nios2_match_break | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | unsigned int * | uimm
| ) |  |
| static

Definition at line 943 of file nios2-tdep.c.

Referenced by nios2_analyze_prologue().

## ◆ nios2_match_calli()

static int nios2_match_calli | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | unsigned int * | uimm
| ) |  |
| static

Definition at line 837 of file nios2-tdep.c.

Referenced by nios2_analyze_prologue(), and nios2_get_next_pc().

## ◆ nios2_match_callr()

static int nios2_match_callr | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | int * | ra
| ) |  |
| static

Definition at line 914 of file nios2-tdep.c.

Referenced by nios2_analyze_prologue(), and nios2_get_next_pc().

## ◆ nios2_match_jmpi()

static int nios2_match_jmpi | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | unsigned int * | uimm
| ) |  |
| static

Definition at line 812 of file nios2-tdep.c.

Referenced by nios2_analyze_prologue(), nios2_get_next_pc(), and nios2_in_epilogue_p().

## ◆ nios2_match_jmpr()

static int nios2_match_jmpr | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | int * | ra
| ) |  |
| static

Definition at line 862 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().

## ◆ nios2_match_ldw()

static int nios2_match_ldw | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | int * | ra,
|  | int * | rb,
|  | int * | imm
| ) |  |
| static

Definition at line 526 of file nios2-tdep.c.

References NIOS2_SP_REGNUM.

Referenced by nios2_in_epilogue_p().

## ◆ nios2_match_ldwm()

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

Definition at line 651 of file nios2-tdep.c.

References NIOS2_SP_REGNUM.

Referenced by nios2_analyze_prologue(), nios2_get_next_pc(), and nios2_in_epilogue_p().

## ◆ nios2_match_orhi()

static int nios2_match_orhi | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | int * | ra,
|  | int * | rb,
|  | unsigned int * | uimm
| ) |  |
| static

Definition at line 440 of file nios2-tdep.c.

Referenced by nios2_analyze_prologue().

## ◆ nios2_match_rdctl()

static int nios2_match_rdctl | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | int * | ra,
|  | int * | rc
| ) |  |
| static

Definition at line 575 of file nios2-tdep.c.

Referenced by nios2_analyze_prologue().

## ◆ nios2_match_stw()

static int nios2_match_stw | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | int * | ra,
|  | int * | rb,
|  | int * | imm
| ) |  |
| static

Definition at line 469 of file nios2-tdep.c.

References NIOS2_SP_REGNUM.

Referenced by nios2_analyze_prologue().

## ◆ nios2_match_stwm()

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

Definition at line 601 of file nios2-tdep.c.

References NIOS2_SP_REGNUM.

Referenced by nios2_analyze_prologue().

## ◆ nios2_match_sub()

static int nios2_match_sub | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | int * | ra,
|  | int * | rb,
|  | int * | rc
| ) |  |
| static

Definition at line 350 of file nios2-tdep.c.

Referenced by nios2_analyze_prologue().

## ◆ nios2_match_trap()

static int nios2_match_trap | ( | uint32_t | insn,
|  | const struct nios2_opcode * | op,
|  | unsigned long | mach,
|  | unsigned int * | uimm
| ) |  |
| static

Definition at line 972 of file nios2-tdep.c.

Referenced by nios2_analyze_prologue(), and nios2_get_next_pc().

## ◆ nios2_push_dummy_call()

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 1814 of file nios2-tdep.c.

References align_up(), check_typedef(), extract_unsigned_integer(), find_function_addr(), gdbarch_byte_order(), NIOS2_FIRST_ARGREG, NIOS2_LAST_ARGREG, NIOS2_RA_REGNUM, NIOS2_SP_REGNUM, regcache_cooked_write_signed(), regcache_cooked_write_unsigned(), TYPE_LENGTH, value_contents(), value_type(), and write_memory().

Referenced by nios2_gdbarch_init().

## ◆ nios2_register_name()

static const char* nios2_register_name | ( | struct gdbarch * | gdbarch,
|  | int | regno
| ) |  |
| static

Definition at line 172 of file nios2-tdep.c.

References NIOS2_NUM_REGS, nios2_reg_names, and tdesc_register_name().

Referenced by nios2_gdbarch_init().

## ◆ nios2_register_type()

static struct type* nios2_register_type | ( | struct gdbarch * | gdbarch,
|  | int | regno
| ) |  |
| static

Definition at line 184 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().

## ◆ nios2_return_value()

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 1786 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().

## ◆ nios2_setup_default()

static void nios2_setup_default | ( | struct nios2_unwind_cache * | cache | ) |
| static

Definition at line 245 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().

## ◆ nios2_skip_prologue()

static CORE_ADDR nios2_skip_prologue | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | start_pc
| ) |  |
| static

Definition at line 1673 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().

## ◆ nios2_software_single_step()

static std::vector<CORE_ADDR> nios2_software_single_step | ( | struct regcache * | regcache | ) |
| static

Definition at line 2209 of file nios2-tdep.c.

References nios2_get_next_pc(), and regcache_read_pc().

Referenced by nios2_gdbarch_init().

## ◆ nios2_stack_frame_destroyed_p()

static int nios2_stack_frame_destroyed_p | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | pc
| ) |  |
| static

Definition at line 1114 of file nios2-tdep.c.

References find_pc_partial_function(), and nios2_in_epilogue_p().

Referenced by nios2_gdbarch_init().

## ◆ nios2_store_return_value()

static void nios2_store_return_value | ( | struct gdbarch * | gdbarch,
|  | struct type * | valtype,
|  | struct regcache * | regcache,
|  | const gdb_byte * | valbuf
| ) |  |
| static

Definition at line 224 of file nios2-tdep.c.

References gdb_assert, NIOS2_R2_REGNUM, NIOS2_R3_REGNUM, regcache_cooked_write(), register_size(), and TYPE_LENGTH.

Referenced by nios2_return_value().

## ◆ nios2_stub_frame_cache()

static struct trad_frame_cache* nios2_stub_frame_cache | ( | struct frame_info * | this_frame,
|  | void ** | this_cache
| ) |  |
| static

Definition at line 2021 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().

## ◆ nios2_stub_frame_prev_register()

static struct value* nios2_stub_frame_prev_register | ( | struct frame_info * | this_frame,
|  | void ** | this_cache,
|  | int | regnum
| ) |  |
| static

Definition at line 2066 of file nios2-tdep.c.

References nios2_stub_frame_cache(), regnum, trad_frame_cache::this_frame, and trad_frame_get_register().

## ◆ nios2_stub_frame_sniffer()

static int nios2_stub_frame_sniffer | ( | const struct frame_unwind * | self,
|  | struct frame_info * | this_frame,
|  | void ** | cache
| ) |  |
| static

Definition at line 2081 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.

## ◆ nios2_stub_frame_this_id()

static void nios2_stub_frame_this_id | ( | struct frame_info * | this_frame,
|  | void ** | this_cache,
|  | struct frame_id * | this_id
| ) |  |
| static

Definition at line 2054 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().

## ◆ nios2_sw_breakpoint_from_kind()

static const gdb_byte* nios2_sw_breakpoint_from_kind | ( | struct gdbarch * | gdbarch,
|  | int | kind,
|  | int * | size
| ) |  |
| static

Definition at line 1721 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().

## ◆ nios2_unwind_pc()

static CORE_ADDR nios2_unwind_pc | ( | struct gdbarch * | gdbarch,
|  | struct frame_info * | next_frame
| ) |  |
| static

Definition at line 1894 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().

## ◆ nios2_unwind_sp()

static CORE_ADDR nios2_unwind_sp | ( | struct gdbarch * | gdbarch,
|  | struct frame_info * | this_frame
| ) |  |
| static

Definition at line 1905 of file nios2-tdep.c.

References frame_unwind_register_unsigned(), and NIOS2_SP_REGNUM.

Referenced by nios2_gdbarch_init().

## Variable Documentation

## ◆ nios2_debug

int nios2_debug = 0
| static

Definition at line 55 of file nios2-tdep.c.

Referenced by _initialize_nios2_tdep(), and nios2_analyze_prologue().

## ◆ nios2_dwarf2gdb_regno_map

int nios2_dwarf2gdb_regno_map[]
| static

Definition at line 107 of file nios2-tdep.c.

Referenced by nios2_dwarf_reg_to_regnum().

## ◆ nios2_frame_base

const struct frame_base nios2_frame_base
| static

Initial value:
=
{
&nios2_frame_unwind,
nios2_frame_base_address,
nios2_frame_base_address,
nios2_frame_base_address
}
nios2_frame_unwind
static const struct frame_unwind nios2_frame_unwind
Definition: nios2-tdep.c:1999
nios2_frame_base_address
static CORE_ADDR nios2_frame_base_address(struct frame_info *this_frame, void **this_cache)
Definition: nios2-tdep.c:1988

Definition at line 2009 of file nios2-tdep.c.

Referenced by nios2_gdbarch_init().

## ◆ nios2_frame_unwind

const struct frame_unwind nios2_frame_unwind
| static

Initial value:
=
{
NORMAL_FRAME,
default_frame_unwind_stop_reason,
nios2_frame_this_id,
nios2_frame_prev_register,
NULL,
default_frame_sniffer
}
NORMAL_FRAME
Definition: frame.h:244
default_frame_sniffer
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
Definition: frame-unwind.c:174
nios2_frame_this_id
static void nios2_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
Definition: nios2-tdep.c:1942
default_frame_unwind_stop_reason
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
Definition: frame-unwind.c:184
nios2_frame_prev_register
static struct value * nios2_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
Definition: nios2-tdep.c:1958

Definition at line 1999 of file nios2-tdep.c.

Referenced by nios2_gdbarch_init().

## ◆ nios2_reg_names

const char* const nios2_reg_names[NIOS2_NUM_REGS]
| static

Initial value:
=
{
"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", "sstatus", "ra",
"pc",
"status", "estatus", "bstatus", "ienable",
"ipending", "cpuid", "ctl6", "exception",
"pteaddr", "tlbacc", "tlbmisc", "eccinj",
"badaddr", "config", "mpubase", "mpuacc"
}

Definition at line 156 of file nios2-tdep.c.

Referenced by nios2_gdbarch_init(), and nios2_register_name().

## ◆ nios2_stub_frame_unwind

const struct frame_unwind nios2_stub_frame_unwind
| static

Initial value:
=
{
NORMAL_FRAME,
default_frame_unwind_stop_reason,
nios2_stub_frame_this_id,
nios2_stub_frame_prev_register,
NULL,
nios2_stub_frame_sniffer
}
nios2_stub_frame_sniffer
static int nios2_stub_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **cache)
Definition: nios2-tdep.c:2081
NORMAL_FRAME
Definition: frame.h:244
nios2_stub_frame_this_id
static void nios2_stub_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
Definition: nios2-tdep.c:2054
nios2_stub_frame_prev_register
static struct value * nios2_stub_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
Definition: nios2-tdep.c:2066
default_frame_unwind_stop_reason
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
Definition: frame-unwind.c:184

Definition at line 2099 of file nios2-tdep.c.

Referenced by nios2_gdbarch_init().