GDB (xrefs)
Defines | Functions | Variables
/home/stan/gdb/src/gdb/microblaze-tdep.c File Reference
#include "defs.h"
#include "arch-utils.h"
#include "dis-asm.h"
#include "frame.h"
#include "trad-frame.h"
#include "symtab.h"
#include "value.h"
#include "gdbcmd.h"
#include "breakpoint.h"
#include "inferior.h"
#include "regcache.h"
#include "target.h"
#include "frame-base.h"
#include "frame-unwind.h"
#include "dwarf2-frame.h"
#include "osabi.h"
#include "gdb_assert.h"
#include "gdb_string.h"
#include "target-descriptions.h"
#include "opcodes/microblaze-opcm.h"
#include "opcodes/microblaze-dis.h"
#include "microblaze-tdep.h"

Go to the source code of this file.

Defines

#define IS_RETURN(op)   (op == rtsd || op == rtid)
#define IS_UPDATE_SP(op, rd, ra)   ((op == addik || op == addi) && rd == REG_SP && ra == REG_SP)
#define IS_SPILL_SP(op, rd, ra)   ((op == swi || op == sw) && rd == REG_SP && ra == REG_SP)
#define IS_SPILL_REG(op, rd, ra)   ((op == swi || op == sw) && rd != REG_SP && ra == REG_SP)
#define IS_ALSO_SPILL_REG(op, rd, ra, rb)   ((op == swi || op == sw) && rd != REG_SP && ra == 0 && rb == REG_SP)
#define IS_SETUP_FP(op, ra, rb)   ((op == add || op == addik || op == addk) && ra == REG_SP && rb == 0)
#define IS_SPILL_REG_FP(op, rd, ra, fpregnum)   ((op == swi || op == sw) && rd != REG_SP && ra == fpregnum && ra != 0)
#define IS_SAVE_HIDDEN_PTR(op, rd, ra, rb)   ((op == add || op == addik) && ra == MICROBLAZE_FIRST_ARGREG && rb == 0)
#define MICROBLAZE_NUM_REGS   ARRAY_SIZE (microblaze_register_names)
#define MICROBLAZE_MY_FRAME_IN_SP   0x1
#define MICROBLAZE_MY_FRAME_IN_FP   0x2

Functions

static void microblaze_debug (const char *fmt,...)
static const char * microblaze_register_name (struct gdbarch *gdbarch, int regnum)
static struct typemicroblaze_register_type (struct gdbarch *gdbarch, int regnum)
static unsigned long microblaze_fetch_instruction (CORE_ADDR pc)
static CORE_ADDR microblaze_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funcaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache)
static CORE_ADDR microblaze_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 const gdb_bytemicroblaze_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len)
static struct
microblaze_frame_cache
microblaze_alloc_frame_cache (void)
static CORE_ADDR microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, struct microblaze_frame_cache *cache)
static CORE_ADDR microblaze_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
static CORE_ADDR microblaze_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
static struct
microblaze_frame_cache
microblaze_frame_cache (struct frame_info *next_frame, void **this_cache)
static void microblaze_frame_this_id (struct frame_info *next_frame, void **this_cache, struct frame_id *this_id)
static struct valuemicroblaze_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum)
static CORE_ADDR microblaze_frame_base_address (struct frame_info *next_frame, void **this_cache)
static void microblaze_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf)
static void microblaze_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
static enum return_value_convention microblaze_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static int microblaze_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
static void microblaze_write_pc (struct regcache *regcache, CORE_ADDR pc)
static int microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg)
static struct gdbarchmicroblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
void _initialize_microblaze_tdep (void)

Variables

static const char * microblaze_register_names []
static unsigned int microblaze_debug_flag = 0
static struct frame_unwind microblaze_frame_unwind
static struct frame_base microblaze_frame_base
static int dwarf2_to_reg_map [78]

Define Documentation

#define IS_ALSO_SPILL_REG (   op,
  rd,
  ra,
  rb 
)    ((op == swi || op == sw) && rd != REG_SP && ra == 0 && rb == REG_SP)

Definition at line 57 of file microblaze-tdep.c.

Referenced by microblaze_analyze_prologue().

#define IS_RETURN (   op)    (op == rtsd || op == rtid)

Definition at line 50 of file microblaze-tdep.c.

Referenced by microblaze_analyze_prologue().

#define IS_SAVE_HIDDEN_PTR (   op,
  rd,
  ra,
  rb 
)    ((op == add || op == addik) && ra == MICROBLAZE_FIRST_ARGREG && rb == 0)

Definition at line 63 of file microblaze-tdep.c.

Referenced by microblaze_analyze_prologue().

#define IS_SETUP_FP (   op,
  ra,
  rb 
)    ((op == add || op == addik || op == addk) && ra == REG_SP && rb == 0)

Definition at line 59 of file microblaze-tdep.c.

Referenced by microblaze_analyze_prologue().

#define IS_SPILL_REG (   op,
  rd,
  ra 
)    ((op == swi || op == sw) && rd != REG_SP && ra == REG_SP)

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

Referenced by microblaze_analyze_prologue().

#define IS_SPILL_REG_FP (   op,
  rd,
  ra,
  fpregnum 
)    ((op == swi || op == sw) && rd != REG_SP && ra == fpregnum && ra != 0)

Definition at line 61 of file microblaze-tdep.c.

Referenced by microblaze_analyze_prologue().

#define IS_SPILL_SP (   op,
  rd,
  ra 
)    ((op == swi || op == sw) && rd == REG_SP && ra == REG_SP)

Definition at line 53 of file microblaze-tdep.c.

Referenced by microblaze_analyze_prologue().

#define IS_UPDATE_SP (   op,
  rd,
  ra 
)    ((op == addik || op == addi) && rd == REG_SP && ra == REG_SP)

Definition at line 51 of file microblaze-tdep.c.

Referenced by microblaze_analyze_prologue().

#define MICROBLAZE_MY_FRAME_IN_FP   0x2

Definition at line 202 of file microblaze-tdep.c.

Referenced by microblaze_analyze_prologue().

#define MICROBLAZE_MY_FRAME_IN_SP   0x1

Definition at line 195 of file microblaze-tdep.c.

Referenced by microblaze_analyze_prologue().

Definition at line 80 of file microblaze-tdep.c.

Referenced by microblaze_gdbarch_init(), and microblaze_register_name().


Function Documentation

void _initialize_microblaze_tdep ( void  )
static struct microblaze_frame_cache* microblaze_alloc_frame_cache ( void  ) [static, read]
static CORE_ADDR microblaze_analyze_prologue ( struct gdbarch gdbarch,
CORE_ADDR  pc,
CORE_ADDR  current_pc,
struct microblaze_frame_cache cache 
) [static]
static const gdb_byte* microblaze_breakpoint_from_pc ( struct gdbarch gdbarch,
CORE_ADDR pc,
int len 
) [static]

Definition at line 161 of file microblaze-tdep.c.

References MICROBLAZE_BREAKPOINT.

Referenced by microblaze_gdbarch_init().

static void microblaze_debug ( const char *  fmt,
  ... 
) [static]
static int microblaze_dwarf2_reg_to_regnum ( struct gdbarch gdbarch,
int  reg 
) [static]

Definition at line 662 of file microblaze-tdep.c.

References dwarf2_to_reg_map, and gdb_assert.

Referenced by microblaze_gdbarch_init().

static void microblaze_extract_return_value ( struct type type,
struct regcache regcache,
gdb_byte valbuf 
) [static]
static unsigned long microblaze_fetch_instruction ( CORE_ADDR  pc) [static]
static CORE_ADDR microblaze_frame_base_address ( struct frame_info next_frame,
void **  this_cache 
) [static]

Definition at line 531 of file microblaze-tdep.c.

References microblaze_frame_cache::base, and microblaze_frame_cache().

static struct microblaze_frame_cache* microblaze_frame_cache ( struct frame_info next_frame,
void **  this_cache 
) [static, read]
static struct value* microblaze_frame_prev_register ( struct frame_info this_frame,
void **  this_cache,
int  regnum 
) [static, read]
static void microblaze_frame_this_id ( struct frame_info next_frame,
void **  this_cache,
struct frame_id this_id 
) [static]
static struct gdbarch* microblaze_gdbarch_init ( struct gdbarch_info  info,
struct gdbarch_list arches 
) [static, read]
static CORE_ADDR microblaze_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 151 of file microblaze-tdep.c.

References _, and error().

Referenced by microblaze_gdbarch_init().

static CORE_ADDR microblaze_push_dummy_code ( struct gdbarch gdbarch,
CORE_ADDR  sp,
CORE_ADDR  funcaddr,
struct value **  args,
int  nargs,
struct type value_type,
CORE_ADDR real_pc,
CORE_ADDR bp_addr,
struct regcache regcache 
) [static]

Definition at line 138 of file microblaze-tdep.c.

References _, and error().

Referenced by microblaze_gdbarch_init().

static const char* microblaze_register_name ( struct gdbarch gdbarch,
int  regnum 
) [static]

Definition at line 101 of file microblaze-tdep.c.

References MICROBLAZE_NUM_REGS, microblaze_register_names, and regnum.

Referenced by microblaze_gdbarch_init().

static struct type* microblaze_register_type ( struct gdbarch gdbarch,
int  regnum 
) [static, read]
static enum return_value_convention microblaze_return_value ( struct gdbarch gdbarch,
struct value function,
struct type type,
struct regcache regcache,
gdb_byte readbuf,
const gdb_byte writebuf 
) [static]
static CORE_ADDR microblaze_skip_prologue ( struct gdbarch gdbarch,
CORE_ADDR  start_pc 
) [static]
static int microblaze_stabs_argument_has_addr ( struct gdbarch gdbarch,
struct type type 
) [static]

Definition at line 627 of file microblaze-tdep.c.

References TYPE_LENGTH.

Referenced by microblaze_gdbarch_init().

static void microblaze_store_return_value ( struct type type,
struct regcache regcache,
const gdb_byte valbuf 
) [static]
static CORE_ADDR microblaze_unwind_pc ( struct gdbarch gdbarch,
struct frame_info next_frame 
) [static]
static void microblaze_write_pc ( struct regcache regcache,
CORE_ADDR  pc 
) [static]

Definition at line 633 of file microblaze-tdep.c.

References MICROBLAZE_PC_REGNUM, and regcache_cooked_write_unsigned().

Referenced by microblaze_gdbarch_init().


Variable Documentation

int dwarf2_to_reg_map[78] [static]
Initial value:
{ 0  ,   1  ,   2  ,   3  ,  
  4  ,   5  ,   6  ,   7  ,  
  8  ,   9  ,  10  ,  11  ,  
  12 ,  13  ,  14  ,  15  ,  
  16 ,  17  ,  18  ,  19  ,  
  20 ,  21  ,  22  ,  23  ,  
  24 ,  25  ,  26  ,  27  ,  
  28 ,  29  ,  30  ,  31  ,  
  -1 ,  -1  ,  -1  ,  -1  ,  
  -1 ,  -1  ,  -1  ,  -1  ,  
  -1 ,  -1  ,  -1  , -1  , 
  -1 , -1  , -1  , -1  , 
  -1 , -1  , -1  , -1  , 
  -1 , -1  , -1  , -1  , 
  -1 , -1  , -1  , -1  , 
  -1 , -1  , -1  , -1  , 
  -1 , -1  , -1  , 33  , 
  -1 , -1  , -1  , -1  , 
  -1 , -1  , -1  , -1  , 
  -1 , -1                                        
}

Definition at line 638 of file microblaze-tdep.c.

Referenced by microblaze_dwarf2_reg_to_regnum().

unsigned int microblaze_debug_flag = 0 [static]

Definition at line 82 of file microblaze-tdep.c.

Referenced by microblaze_debug().

Initial value:

Definition at line 540 of file microblaze-tdep.c.

const char* microblaze_register_names[] [static]
Initial value:
{
  "r0",   "r1",  "r2",    "r3",   "r4",   "r5",   "r6",   "r7",
  "r8",   "r9",  "r10",   "r11",  "r12",  "r13",  "r14",  "r15",
  "r16",  "r17", "r18",   "r19",  "r20",  "r21",  "r22",  "r23",
  "r24",  "r25", "r26",   "r27",  "r28",  "r29",  "r30",  "r31",
  "rpc",  "rmsr", "rear", "resr", "rfsr", "rbtr",
  "rpvr0", "rpvr1", "rpvr2", "rpvr3", "rpvr4", "rpvr5", "rpvr6",
  "rpvr7", "rpvr8", "rpvr9", "rpvr10", "rpvr11",
  "redr", "rpid", "rzpr", "rtlbx", "rtlbsx", "rtlblo", "rtlbhi"
}

Definition at line 68 of file microblaze-tdep.c.

Referenced by microblaze_register_name().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines