GDB (xrefs)
Classes | Functions | Variables
/home/stan/gdb/src/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 "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.

Classes

struct  reg_value
struct  reg_saved
struct  nios2_unwind_cache
struct  wild_insn

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 typenios2_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 int nios2_in_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR current_pc, CORE_ADDR start_pc)
static int nios2_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
static int nios2_match_sequence (struct gdbarch *gdbarch, CORE_ADDR start_pc, const wild_insn *sequence, int count)
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_bytenios2_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_cachenios2_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 valuenios2_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_cachenios2_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 valuenios2_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_stub_frame_base_address (struct frame_info *this_frame, void **this_cache)
static unsigned long nios2_fetch_instruction (struct gdbarch *gdbarch, CORE_ADDR pc)
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 gdbarchnios2_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 wild_insn profiler_insn []
static const wild_insn irqentry_insn []
static struct frame_unwind nios2_frame_unwind
static struct frame_base nios2_frame_base
static struct frame_unwind nios2_stub_frame_unwind
static struct frame_base nios2_stub_frame_base
initialize_file_ftype _initialize_nios2_tdep

Function Documentation

void _initialize_nios2_tdep ( void  )
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]
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]
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]
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]
static void nios2_frame_this_id ( struct frame_info this_frame,
void **  this_cache,
struct frame_id this_id 
) [static]
static struct nios2_unwind_cache* nios2_frame_unwind_cache ( struct frame_info this_frame,
void **  this_prologue_cache 
) [static, read]
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]
static CORE_ADDR nios2_get_next_pc ( struct frame_info frame,
CORE_ADDR  pc 
) [static]
static int nios2_in_epilogue_p ( struct gdbarch gdbarch,
CORE_ADDR  current_pc,
CORE_ADDR  start_pc 
) [static]
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]
static int nios2_match_sequence ( struct gdbarch gdbarch,
CORE_ADDR  start_pc,
const wild_insn sequence,
int  count 
) [static]
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]
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]
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]
static void nios2_setup_default ( struct nios2_unwind_cache cache) [static]
static CORE_ADDR nios2_skip_prologue ( struct gdbarch gdbarch,
CORE_ADDR  start_pc 
) [static]
static int nios2_software_single_step ( struct frame_info frame) [static]
static void nios2_store_return_value ( struct gdbarch gdbarch,
struct type valtype,
struct regcache regcache,
const gdb_byte valbuf 
) [static]
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]
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]
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().


Variable Documentation

Initial value:
{
  { 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().

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

Referenced by nios2_dwarf_reg_to_regnum().

struct frame_base nios2_frame_base [static]
Initial value:

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

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", "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().

Initial value:

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

Initial value:
{
  { 0x0010e03a, 0x00000000 }, 
  { 0xf813883a, 0x00000000 }, 
  { 0x02800034, 0x003fffc0 }, 
  { 0x52800004, 0x003fffc0 }, 
  { 0x00000000, 0xffffffc0 }, 
  { 0x483f883a, 0x00000000 }  
}

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

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines