GDB (xrefs)
Classes | Defines | Functions | Variables
/home/stan/gdb/src/gdb/bfin-tdep.c File Reference
#include "defs.h"
#include "gdb_string.h"
#include "inferior.h"
#include "gdbcore.h"
#include "arch-utils.h"
#include "regcache.h"
#include "frame.h"
#include "frame-unwind.h"
#include "frame-base.h"
#include "trad-frame.h"
#include "dis-asm.h"
#include "gdb_assert.h"
#include "sim-regno.h"
#include "gdb/sim-bfin.h"
#include "dwarf2-frame.h"
#include "symtab.h"
#include "elf-bfd.h"
#include "elf/bfin.h"
#include "osabi.h"
#include "infcall.h"
#include "xml-syscall.h"
#include "bfin-tdep.h"

Go to the source code of this file.

Classes

struct  bfin_frame_cache

Defines

#define P_LINKAGE   0xE800
#define P_MINUS_SP1   0x0140
#define P_MINUS_SP2   0x05C0
#define P_MINUS_SP3   0x0540
#define P_MINUS_SP4   0x04C0
#define P_SP_PLUS   0x6C06
#define P_P2_LOW   0xE10A
#define P_P2_HIGH   0XE14A
#define P_SP_EQ_SP_PLUS_P2   0X5BB2
#define P_SP_EQ_P2_PLUS_SP   0x5B96
#define P_MINUS_MINUS_SP_EQ_RETS   0x0167
#define P_16_BIT_INSR_MAX   0xBFFF
#define P_32_BIT_INSR_MIN   0xC000
#define P_32_BIT_INSR_MAX   0xE801
#define P_JUMP_PREG_MIN   0x0050
#define P_JUMP_PREG_MAX   0x0057
#define P_JUMP_PC_PLUS_PREG_MIN   0x0080
#define P_JUMP_PC_PLUS_PREG_MAX   0x0087
#define P_JUMP_S_MIN   0x2000
#define P_JUMP_S_MAX   0x2FFF
#define P_JUMP_L_MIN   0xE200
#define P_JUMP_L_MAX   0xE2FF
#define P_IF_CC_JUMP_MIN   0x1800
#define P_IF_CC_JUMP_MAX   0x1BFF
#define P_IF_CC_JUMP_BP_MIN   0x1C00
#define P_IF_CC_JUMP_BP_MAX   0x1FFF
#define P_IF_NOT_CC_JUMP_MIN   0x1000
#define P_IF_NOT_CC_JUMP_MAX   0x13FF
#define P_IF_NOT_CC_JUMP_BP_MIN   0x1400
#define P_IF_NOT_CC_JUMP_BP_MAX   0x17FF
#define P_CALL_PREG_MIN   0x0060
#define P_CALL_PREG_MAX   0x0067
#define P_CALL_PC_PLUS_PREG_MIN   0x0070
#define P_CALL_PC_PLUS_PREG_MAX   0x0077
#define P_CALL_MIN   0xE300
#define P_CALL_MAX   0xE3FF
#define P_RTS   0x0010
#define P_MNOP   0xC803
#define P_EXCPT_MIN   0x00A0
#define P_EXCPT_MAX   0x00AF
#define P_BIT_MULTI_INS_1   0xC000
#define P_BIT_MULTI_INS_2   0x0800
#define UPPER_LIMIT   40
#define ASTAT_CC_POS   5
#define ASTAT_CC   (1 << ASTAT_CC_POS)
#define NUM_BFIN_REGNAMES   ARRAY_SIZE (bfin_register_name_strings)

Functions

static struct bfin_frame_cachebfin_alloc_frame_cache (void)
static struct bfin_frame_cachebfin_frame_cache (struct frame_info *this_frame, void **this_cache)
static void bfin_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static struct valuebfin_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum)
static int is_minus_minus_sp (int op)
static CORE_ADDR bfin_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
static struct typebfin_register_type (struct gdbarch *gdbarch, int regnum)
static CORE_ADDR bfin_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 int bfin_reg_to_regnum (struct gdbarch *gdbarch, int reg)
static const unsigned char * bfin_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
static void bfin_extract_return_value (struct type *type, struct regcache *regs, gdb_byte *dst)
static void bfin_store_return_value (struct type *type, struct regcache *regs, const gdb_byte *src)
static enum return_value_convention bfin_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static const char * bfin_register_name (struct gdbarch *gdbarch, int i)
static enum register_status bfin_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int regnum, gdb_byte *buffer)
static void bfin_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int regnum, const gdb_byte *buffer)
static CORE_ADDR bfin_frame_base_address (struct frame_info *this_frame, void **this_cache)
static CORE_ADDR bfin_frame_local_address (struct frame_info *this_frame, void **this_cache)
static CORE_ADDR bfin_frame_args_address (struct frame_info *this_frame, void **this_cache)
static struct frame_id bfin_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
static CORE_ADDR bfin_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
static CORE_ADDR bfin_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
enum bfin_abi bfin_abi (struct gdbarch *gdbarch)
static struct gdbarchbfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
void _initialize_bfin_tdep (void)

Variables

static const char *const bfin_register_name_strings []
static const int map_gcc_gdb []
static struct frame_unwind bfin_frame_unwind
static struct frame_base bfin_frame_base
initialize_file_ftype _initialize_bfin_tdep

Define Documentation

#define ASTAT_CC   (1 << ASTAT_CC_POS)

Definition at line 127 of file bfin-tdep.c.

Referenced by bfin_pseudo_register_read(), and bfin_pseudo_register_write().

#define ASTAT_CC_POS   5

Definition at line 126 of file bfin-tdep.c.

Referenced by bfin_pseudo_register_write().

#define NUM_BFIN_REGNAMES   ARRAY_SIZE (bfin_register_name_strings)

Definition at line 143 of file bfin-tdep.c.

#define P_16_BIT_INSR_MAX   0xBFFF

Definition at line 60 of file bfin-tdep.c.

#define P_32_BIT_INSR_MAX   0xE801

Definition at line 64 of file bfin-tdep.c.

#define P_32_BIT_INSR_MIN   0xC000

Definition at line 62 of file bfin-tdep.c.

#define P_BIT_MULTI_INS_1   0xC000

Definition at line 118 of file bfin-tdep.c.

#define P_BIT_MULTI_INS_2   0x0800

Definition at line 120 of file bfin-tdep.c.

#define P_CALL_MAX   0xE3FF

Definition at line 108 of file bfin-tdep.c.

#define P_CALL_MIN   0xE300

Definition at line 106 of file bfin-tdep.c.

#define P_CALL_PC_PLUS_PREG_MAX   0x0077

Definition at line 104 of file bfin-tdep.c.

#define P_CALL_PC_PLUS_PREG_MIN   0x0070

Definition at line 102 of file bfin-tdep.c.

#define P_CALL_PREG_MAX   0x0067

Definition at line 100 of file bfin-tdep.c.

#define P_CALL_PREG_MIN   0x0060

Definition at line 98 of file bfin-tdep.c.

#define P_EXCPT_MAX   0x00AF

Definition at line 116 of file bfin-tdep.c.

#define P_EXCPT_MIN   0x00A0

Definition at line 114 of file bfin-tdep.c.

#define P_IF_CC_JUMP_BP_MAX   0x1FFF

Definition at line 88 of file bfin-tdep.c.

#define P_IF_CC_JUMP_BP_MIN   0x1C00

Definition at line 86 of file bfin-tdep.c.

#define P_IF_CC_JUMP_MAX   0x1BFF

Definition at line 84 of file bfin-tdep.c.

#define P_IF_CC_JUMP_MIN   0x1800

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

#define P_IF_NOT_CC_JUMP_BP_MAX   0x17FF

Definition at line 96 of file bfin-tdep.c.

#define P_IF_NOT_CC_JUMP_BP_MIN   0x1400

Definition at line 94 of file bfin-tdep.c.

#define P_IF_NOT_CC_JUMP_MAX   0x13FF

Definition at line 92 of file bfin-tdep.c.

#define P_IF_NOT_CC_JUMP_MIN   0x1000

Definition at line 90 of file bfin-tdep.c.

#define P_JUMP_L_MAX   0xE2FF

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

#define P_JUMP_L_MIN   0xE200

Definition at line 78 of file bfin-tdep.c.

#define P_JUMP_PC_PLUS_PREG_MAX   0x0087

Definition at line 72 of file bfin-tdep.c.

Referenced by bfin_skip_prologue().

#define P_JUMP_PC_PLUS_PREG_MIN   0x0080

Definition at line 70 of file bfin-tdep.c.

Referenced by bfin_skip_prologue().

#define P_JUMP_PREG_MAX   0x0057

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

Referenced by bfin_skip_prologue().

#define P_JUMP_PREG_MIN   0x0050

Definition at line 66 of file bfin-tdep.c.

Referenced by bfin_skip_prologue().

#define P_JUMP_S_MAX   0x2FFF

Definition at line 76 of file bfin-tdep.c.

Referenced by bfin_skip_prologue().

#define P_JUMP_S_MIN   0x2000

Definition at line 74 of file bfin-tdep.c.

Referenced by bfin_skip_prologue().

#define P_LINKAGE   0xE800

Definition at line 46 of file bfin-tdep.c.

Referenced by bfin_skip_prologue().

#define P_MINUS_MINUS_SP_EQ_RETS   0x0167

Definition at line 56 of file bfin-tdep.c.

Referenced by bfin_skip_prologue().

#define P_MINUS_SP1   0x0140

Definition at line 47 of file bfin-tdep.c.

Referenced by is_minus_minus_sp().

#define P_MINUS_SP2   0x05C0

Definition at line 48 of file bfin-tdep.c.

Referenced by is_minus_minus_sp().

#define P_MINUS_SP3   0x0540

Definition at line 49 of file bfin-tdep.c.

Referenced by is_minus_minus_sp().

#define P_MINUS_SP4   0x04C0

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

Referenced by is_minus_minus_sp().

#define P_MNOP   0xC803

Definition at line 112 of file bfin-tdep.c.

#define P_P2_HIGH   0XE14A

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

#define P_P2_LOW   0xE10A

Definition at line 52 of file bfin-tdep.c.

#define P_RTS   0x0010

Definition at line 110 of file bfin-tdep.c.

Referenced by bfin_skip_prologue().

#define P_SP_EQ_P2_PLUS_SP   0x5B96

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

#define P_SP_EQ_SP_PLUS_P2   0X5BB2

Definition at line 54 of file bfin-tdep.c.

#define P_SP_PLUS   0x6C06

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

#define UPPER_LIMIT   40

Definition at line 123 of file bfin-tdep.c.

Referenced by bfin_skip_prologue().


Function Documentation

void _initialize_bfin_tdep ( void  )

Definition at line 865 of file bfin-tdep.c.

References _initialize_bfin_tdep, bfin_gdbarch_init(), and register_gdbarch_init().

enum bfin_abi bfin_abi ( struct gdbarch gdbarch)

Definition at line 782 of file bfin-tdep.c.

References gdbarch_tdep::bfin_abi, and gdbarch_tdep().

static struct bfin_frame_cache* bfin_alloc_frame_cache ( void  ) [static, read]
static const unsigned char* bfin_breakpoint_from_pc ( struct gdbarch gdbarch,
CORE_ADDR pcptr,
int lenptr 
) [static]

Definition at line 584 of file bfin-tdep.c.

References gdbarch_byte_order(), read_memory_unsigned_integer(), and target_shortname.

Referenced by bfin_gdbarch_init().

static struct frame_id bfin_dummy_id ( struct gdbarch gdbarch,
struct frame_info this_frame 
) [static, read]

Definition at line 760 of file bfin-tdep.c.

References BFIN_SP_REGNUM, frame_id_build(), get_frame_pc(), get_frame_register_unsigned(), and sp.

Referenced by bfin_gdbarch_init().

static void bfin_extract_return_value ( struct type type,
struct regcache regs,
gdb_byte dst 
) [static]
static CORE_ADDR bfin_frame_align ( struct gdbarch gdbarch,
CORE_ADDR  address 
) [static]

Definition at line 776 of file bfin-tdep.c.

Referenced by bfin_gdbarch_init().

static CORE_ADDR bfin_frame_args_address ( struct frame_info this_frame,
void **  this_cache 
) [static]

Definition at line 744 of file bfin-tdep.c.

References bfin_frame_cache::base, and bfin_frame_cache().

static CORE_ADDR bfin_frame_base_address ( struct frame_info this_frame,
void **  this_cache 
) [static]

Definition at line 728 of file bfin-tdep.c.

References bfin_frame_cache::base, and bfin_frame_cache().

static struct bfin_frame_cache* bfin_frame_cache ( struct frame_info this_frame,
void **  this_cache 
) [static, read]
static CORE_ADDR bfin_frame_local_address ( struct frame_info this_frame,
void **  this_cache 
) [static]

Definition at line 736 of file bfin-tdep.c.

References bfin_frame_cache::base, and bfin_frame_cache().

static struct value* bfin_frame_prev_register ( struct frame_info this_frame,
void **  this_cache,
int  regnum 
) [static, read]
static void bfin_frame_this_id ( struct frame_info this_frame,
void **  this_cache,
struct frame_id this_id 
) [static]
static struct gdbarch* bfin_gdbarch_init ( struct gdbarch_info  info,
struct gdbarch_list arches 
) [static, read]
static enum register_status bfin_pseudo_register_read ( struct gdbarch gdbarch,
struct regcache regcache,
int  regnum,
gdb_byte buffer 
) [static]
static void bfin_pseudo_register_write ( struct gdbarch gdbarch,
struct regcache regcache,
int  regnum,
const gdb_byte buffer 
) [static]
static CORE_ADDR bfin_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 int bfin_reg_to_regnum ( struct gdbarch gdbarch,
int  reg 
) [static]

Definition at line 569 of file bfin-tdep.c.

References map_gcc_gdb.

Referenced by bfin_gdbarch_init().

static const char* bfin_register_name ( struct gdbarch gdbarch,
int  i 
) [static]

Definition at line 685 of file bfin-tdep.c.

References bfin_register_name_strings.

Referenced by bfin_gdbarch_init().

static struct type* bfin_register_type ( struct gdbarch gdbarch,
int  regnum 
) [static, read]
static enum return_value_convention bfin_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 bfin_skip_prologue ( struct gdbarch gdbarch,
CORE_ADDR  pc 
) [static]
static void bfin_store_return_value ( struct type type,
struct regcache regs,
const gdb_byte src 
) [static]

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

References BFIN_R0_REGNUM, gdb_assert, len, regcache_cooked_write(), and TYPE_LENGTH.

Referenced by bfin_return_value().

static CORE_ADDR bfin_unwind_pc ( struct gdbarch gdbarch,
struct frame_info next_frame 
) [static]

Definition at line 770 of file bfin-tdep.c.

References BFIN_PC_REGNUM, and frame_unwind_register_unsigned().

Referenced by bfin_gdbarch_init().

static int is_minus_minus_sp ( int  op) [static]

Definition at line 389 of file bfin-tdep.c.

References P_MINUS_SP1, P_MINUS_SP2, P_MINUS_SP3, and P_MINUS_SP4.

Referenced by bfin_skip_prologue().


Variable Documentation

struct frame_base bfin_frame_base [static]
Initial value:
{
  "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
  "p0", "p1", "p2", "p3", "p4", "p5", "sp", "fp",
  "i0", "i1", "i2", "i3", "m0", "m1", "m2", "m3",
  "b0", "b1", "b2", "b3", "l0", "l1", "l2", "l3",
  "a0x", "a0w", "a1x", "a1w", "astat", "rets",
  "lc0", "lt0", "lb0", "lc1", "lt1", "lb1", "cycles", "cycles2",
  "usp", "seqstat", "syscfg", "reti", "retx", "retn", "rete",
  "pc", "cc",
}

Definition at line 131 of file bfin-tdep.c.

Referenced by bfin_register_name().

const int map_gcc_gdb[] [static]

Definition at line 193 of file bfin-tdep.c.

Referenced by bfin_reg_to_regnum().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines