GDB (xrefs)
Classes | Defines | Typedefs | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/ia64-tdep.c File Reference
#include "defs.h"
#include "inferior.h"
#include "gdbcore.h"
#include "arch-utils.h"
#include "floatformat.h"
#include "gdbtypes.h"
#include "regcache.h"
#include "reggroups.h"
#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
#include "doublest.h"
#include "value.h"
#include "gdb_assert.h"
#include "objfiles.h"
#include "elf/common.h"
#include "elf-bfd.h"
#include "dis-asm.h"
#include "infcall.h"
#include "osabi.h"
#include "ia64-tdep.h"
#include "cp-abi.h"

Go to the source code of this file.

Classes

struct  ia64_frame_cache

Defines

#define SLOT_MULTIPLIER   1
#define BUNDLE_LEN   16
#define NUM_IA64_RAW_REGS   462
#define IA64_BREAKPOINT   0x00003333300LL
#define IS_NaT_COLLECTION_ADDR(addr)   ((((addr) >> 3) & 0x3f) == 0x3f)
#define isScratch(_regnum_)
#define imm9(_instr_)

Typedefs

typedef enum instruction_type instruction_type

Enumerations

enum  instruction_type {
  A, I, M, F,
  B, L, X, undefined
}
enum  pseudo_regs {
  FIRST_PSEUDO_REGNUM = NUM_IA64_RAW_REGS, VBOF_REGNUM = IA64_NAT127_REGNUM + 1, V32_REGNUM, V127_REGNUM = V32_REGNUM + 95,
  VP0_REGNUM, VP16_REGNUM = VP0_REGNUM + 16, VP63_REGNUM = VP0_REGNUM + 63, LAST_PSEUDO_REGNUM
}

Functions

static struct typeis_float_or_hfa_type (struct type *t)
static CORE_ADDR ia64_find_global_pointer (struct gdbarch *gdbarch, CORE_ADDR faddr)
static int floatformat_valid (const struct floatformat *fmt, const void *from)
static struct typeia64_ext_type (struct gdbarch *gdbarch)
static int ia64_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *group)
static const char * ia64_register_name (struct gdbarch *gdbarch, int reg)
struct typeia64_register_type (struct gdbarch *arch, int reg)
static int ia64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
static long long extract_bit_field (const gdb_byte *bundle, int from, int len)
static void replace_bit_field (gdb_byte *bundle, long long val, int from, int len)
static long long slotN_contents (gdb_byte *bundle, int slotnum)
static void replace_slotN_contents (gdb_byte *bundle, long long instr, int slotnum)
static CORE_ADDR fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr)
static int ia64_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static int ia64_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static const gdb_byteia64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
static CORE_ADDR ia64_read_pc (struct regcache *regcache)
void ia64_write_pc (struct regcache *regcache, CORE_ADDR new_pc)
static CORE_ADDR rse_address_add (CORE_ADDR addr, int nslots)
static enum register_status ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int regnum, gdb_byte *buf)
static void ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int regnum, const gdb_byte *buf)
static int ia64_convert_register_p (struct gdbarch *gdbarch, int regno, struct type *type)
static int ia64_register_to_value (struct frame_info *frame, int regnum, struct type *valtype, gdb_byte *out, int *optimizedp, int *unavailablep)
static void ia64_value_to_register (struct frame_info *frame, int regnum, struct type *valtype, const gdb_byte *in)
static CORE_ADDR refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc, int *trust_limit)
static struct ia64_frame_cacheia64_alloc_frame_cache (void)
static CORE_ADDR examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *this_frame, struct ia64_frame_cache *cache)
CORE_ADDR ia64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
static struct ia64_frame_cacheia64_frame_cache (struct frame_info *this_frame, void **this_cache)
static void ia64_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static struct valueia64_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum)
static void ia64_sigtramp_frame_init_saved_regs (struct frame_info *this_frame, struct ia64_frame_cache *cache)
static struct ia64_frame_cacheia64_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
static void ia64_sigtramp_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static struct valueia64_sigtramp_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum)
static int ia64_sigtramp_frame_sniffer (const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
static CORE_ADDR ia64_frame_base_address (struct frame_info *this_frame, void **this_cache)
static int ia64_use_struct_convention (struct type *type)
static int ia64_struct_type_p (const struct type *type)
static void ia64_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf)
static void ia64_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
static enum return_value_convention ia64_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static int is_float_or_hfa_type_recurse (struct type *t, struct type **etp)
static int slot_alignment_is_next_even (struct type *t)
static CORE_ADDR ia64_find_global_pointer_from_dynamic_section (struct gdbarch *gdbarch, CORE_ADDR faddr)
static CORE_ADDR find_extant_func_descr (struct gdbarch *gdbarch, CORE_ADDR faddr)
static CORE_ADDR find_func_descr (struct regcache *regcache, CORE_ADDR faddr, CORE_ADDR *fdaptr)
static CORE_ADDR ia64_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
static CORE_ADDR ia64_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
static void ia64_allocate_new_rse_frame (struct regcache *regcache, ULONGEST bsp, int sof)
static void ia64_store_argument_in_slot (struct regcache *regcache, CORE_ADDR bsp, int slotnum, gdb_byte *buf)
static void ia64_set_function_addr (struct regcache *regcache, CORE_ADDR func_addr)
static CORE_ADDR ia64_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 struct frame_id ia64_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
static CORE_ADDR ia64_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
static int ia64_print_insn (bfd_vma memaddr, struct disassemble_info *info)
static int ia64_size_of_register_frame (struct frame_info *this_frame, ULONGEST cfm)
static struct gdbarchia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
void _initialize_ia64_tdep (void)

Variables

static gdbarch_init_ftype ia64_gdbarch_init
static gdbarch_register_name_ftype ia64_register_name
static gdbarch_register_type_ftype ia64_register_type
static
gdbarch_breakpoint_from_pc_ftype 
ia64_breakpoint_from_pc
static gdbarch_skip_prologue_ftype ia64_skip_prologue
static int sp_regnum = IA64_GR12_REGNUM
static int fp_regnum = IA64_VFP_REGNUM
static int lr_regnum = IA64_VRAP_REGNUM
static char * ia64_register_names []
static struct floatformat floatformat_ia64_ext_little
static struct floatformat floatformat_ia64_ext_big
static struct floatformat * floatformats_ia64_ext [2]
static enum instruction_type template_encoding_table [32][3]
static int max_skip_non_prologue_insns = 40
static struct frame_unwind ia64_frame_unwind
static struct frame_unwind ia64_sigtramp_frame_unwind
static struct frame_base ia64_frame_base
static struct ia64_infcall_ops ia64_infcall_ops
initialize_file_ftype _initialize_ia64_tdep

Define Documentation

#define BUNDLE_LEN   16
#define IA64_BREAKPOINT   0x00003333300LL

Definition at line 635 of file ia64-tdep.c.

Referenced by ia64_memory_insert_breakpoint(), and ia64_memory_remove_breakpoint().

#define imm9 (   _instr_)
Value:
( ((((_instr_) & 0x01000000000LL) ? -1 : 0) << 8) \
   | (((_instr_) & 0x00008000000LL) >> 20) \
   | (((_instr_) & 0x00000001fc0LL) >> 6))

Definition at line 1326 of file ia64-tdep.c.

Referenced by examine_prologue().

#define IS_NaT_COLLECTION_ADDR (   addr)    ((((addr) >> 3) & 0x3f) == 0x3f)

Definition at line 912 of file ia64-tdep.c.

Referenced by examine_prologue(), and rse_address_add().

#define isScratch (   _regnum_)
Value:
((_regnum_) == 2 || (_regnum_) == 3 \
  || (8 <= (_regnum_) && (_regnum_) <= 11) \
  || (14 <= (_regnum_) && (_regnum_) <= 31))

Definition at line 1323 of file ia64-tdep.c.

Referenced by examine_prologue().

#define NUM_IA64_RAW_REGS   462
#define SLOT_MULTIPLIER   1

Typedef Documentation


Enumeration Type Documentation

Enumerator:
A 
I 
M 
F 
B 
L 
X 
undefined 

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

Enumerator:
FIRST_PSEUDO_REGNUM 
VBOF_REGNUM 
V32_REGNUM 
V127_REGNUM 
VP0_REGNUM 
VP16_REGNUM 
VP63_REGNUM 
LAST_PSEUDO_REGNUM 

Definition at line 137 of file ia64-tdep.c.


Function Documentation

void _initialize_ia64_tdep ( void  )

Definition at line 4058 of file ia64-tdep.c.

References gdbarch_register(), and ia64_gdbarch_init.

static CORE_ADDR examine_prologue ( CORE_ADDR  pc,
CORE_ADDR  lim_pc,
struct frame_info this_frame,
struct ia64_frame_cache cache 
) [static]
static long long extract_bit_field ( const gdb_byte bundle,
int  from,
int  len 
) [static]
static CORE_ADDR fetch_instruction ( CORE_ADDR  addr,
instruction_type it,
long long *  instr 
) [static]
static CORE_ADDR find_extant_func_descr ( struct gdbarch gdbarch,
CORE_ADDR  faddr 
) [static]
static CORE_ADDR find_func_descr ( struct regcache regcache,
CORE_ADDR  faddr,
CORE_ADDR fdaptr 
) [static]
static int floatformat_valid ( const struct floatformat *  fmt,
const void *  from 
) [static]

Definition at line 286 of file ia64-tdep.c.

static struct ia64_frame_cache* ia64_alloc_frame_cache ( void  ) [static, read]
static void ia64_allocate_new_rse_frame ( struct regcache regcache,
ULONGEST  bsp,
int  sof 
) [static]
static const gdb_byte* ia64_breakpoint_from_pc ( struct gdbarch gdbarch,
CORE_ADDR pcptr,
int lenptr 
) [static]
static CORE_ADDR ia64_convert_from_func_ptr_addr ( struct gdbarch gdbarch,
CORE_ADDR  addr,
struct target_ops targ 
) [static]
static int ia64_convert_register_p ( struct gdbarch gdbarch,
int  regno,
struct type type 
) [static]

Definition at line 1215 of file ia64-tdep.c.

References ia64_ext_type(), IA64_FR0_REGNUM, and IA64_FR127_REGNUM.

Referenced by ia64_gdbarch_init().

static struct frame_id ia64_dummy_id ( struct gdbarch gdbarch,
struct frame_info this_frame 
) [static, read]
static int ia64_dwarf_reg_to_regnum ( struct gdbarch gdbarch,
int  reg 
) [static]

Definition at line 361 of file ia64-tdep.c.

References IA64_GR127_REGNUM, IA64_GR32_REGNUM, and V32_REGNUM.

Referenced by ia64_gdbarch_init().

static struct type* ia64_ext_type ( struct gdbarch gdbarch) [static, read]
static void ia64_extract_return_value ( struct type type,
struct regcache regcache,
gdb_byte valbuf 
) [static]
static CORE_ADDR ia64_find_global_pointer ( struct gdbarch gdbarch,
CORE_ADDR  faddr 
) [static]
static CORE_ADDR ia64_find_global_pointer_from_dynamic_section ( struct gdbarch gdbarch,
CORE_ADDR  faddr 
) [static]
static CORE_ADDR ia64_frame_align ( struct gdbarch gdbarch,
CORE_ADDR  sp 
) [static]

Definition at line 3666 of file ia64-tdep.c.

Referenced by ia64_gdbarch_init().

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

Definition at line 2372 of file ia64-tdep.c.

References ia64_frame_cache::base, and ia64_frame_cache().

static struct ia64_frame_cache* ia64_frame_cache ( struct frame_info this_frame,
void **  this_cache 
) [static, read]
static struct value* ia64_frame_prev_register ( struct frame_info this_frame,
void **  this_cache,
int  regnum 
) [static, read]
static void ia64_frame_this_id ( struct frame_info this_frame,
void **  this_cache,
struct frame_id this_id 
) [static]
static struct gdbarch* ia64_gdbarch_init ( struct gdbarch_info  info,
struct gdbarch_list arches 
) [static, read]

Definition at line 3956 of file ia64-tdep.c.

References core_addr_lessthan(), FIRST_PSEUDO_REGNUM, floatformats_i387_ext, frame_base_set_default(), frame_unwind_append_unwinder(), gdbarch_list::gdbarch, gdbarch_alloc(), gdbarch_init_osabi(), gdbarch_list_lookup_by_info(), ia64_breakpoint_from_pc, ia64_convert_from_func_ptr_addr(), ia64_convert_register_p(), ia64_dummy_id(), ia64_dwarf_reg_to_regnum(), IA64_FR0_REGNUM, ia64_frame_align(), ia64_infcall_ops, ia64_memory_insert_breakpoint(), ia64_memory_remove_breakpoint(), ia64_print_insn(), ia64_pseudo_register_read(), ia64_pseudo_register_write(), ia64_push_dummy_call(), ia64_read_pc(), ia64_register_name, ia64_register_reggroup_p(), ia64_register_to_value(), ia64_register_type, ia64_return_value(), ia64_size_of_register_frame(), ia64_skip_prologue, ia64_unwind_pc(), ia64_value_to_register(), ia64_write_pc(), gdbarch_tdep::infcall_ops, LAST_PSEUDO_REGNUM, libunwind_frame_set_descr(), NUM_IA64_RAW_REGS, set_gdbarch_breakpoint_from_pc(), set_gdbarch_convert_from_func_ptr_addr(), set_gdbarch_convert_register_p(), set_gdbarch_double_bit(), set_gdbarch_dummy_id(), set_gdbarch_dwarf2_reg_to_regnum(), set_gdbarch_float_bit(), set_gdbarch_fp0_regnum(), set_gdbarch_frame_align(), set_gdbarch_inner_than(), set_gdbarch_int_bit(), set_gdbarch_long_bit(), set_gdbarch_long_double_bit(), set_gdbarch_long_double_format(), set_gdbarch_long_long_bit(), set_gdbarch_memory_insert_breakpoint(), set_gdbarch_memory_remove_breakpoint(), set_gdbarch_num_pseudo_regs(), set_gdbarch_num_regs(), set_gdbarch_print_insn(), set_gdbarch_pseudo_register_read(), set_gdbarch_pseudo_register_write(), set_gdbarch_ptr_bit(), set_gdbarch_push_dummy_call(), set_gdbarch_read_pc(), set_gdbarch_register_name(), set_gdbarch_register_reggroup_p(), set_gdbarch_register_to_value(), set_gdbarch_register_type(), set_gdbarch_return_value(), set_gdbarch_short_bit(), set_gdbarch_skip_prologue(), set_gdbarch_sp_regnum(), set_gdbarch_unwind_pc(), set_gdbarch_value_to_register(), set_gdbarch_vtable_function_descriptors(), set_gdbarch_write_pc(), gdbarch_tdep::size_of_register_frame, sp_regnum, and xzalloc().

static int ia64_memory_insert_breakpoint ( struct gdbarch gdbarch,
struct bp_target_info bp_tgt 
) [static]
static int ia64_memory_remove_breakpoint ( struct gdbarch gdbarch,
struct bp_target_info bp_tgt 
) [static]
static int ia64_print_insn ( bfd_vma  memaddr,
struct disassemble_info *  info 
) [static]

Definition at line 3941 of file ia64-tdep.c.

References SLOT_MULTIPLIER.

Referenced by ia64_gdbarch_init().

static enum register_status ia64_pseudo_register_read ( struct gdbarch gdbarch,
struct regcache regcache,
int  regnum,
gdb_byte buf 
) [static]
static void ia64_pseudo_register_write ( struct gdbarch gdbarch,
struct regcache regcache,
int  regnum,
const gdb_byte buf 
) [static]
static CORE_ADDR ia64_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 CORE_ADDR ia64_read_pc ( struct regcache regcache) [static]
static const char* ia64_register_name ( struct gdbarch gdbarch,
int  reg 
) [static]

Definition at line 346 of file ia64-tdep.c.

References ia64_register_names.

static int ia64_register_reggroup_p ( struct gdbarch gdbarch,
int  regnum,
struct reggroup group 
) [static]
static int ia64_register_to_value ( struct frame_info frame,
int  regnum,
struct type valtype,
gdb_byte out,
int optimizedp,
int unavailablep 
) [static]
struct type* ia64_register_type ( struct gdbarch arch,
int  reg 
) [read]
static enum return_value_convention ia64_return_value ( struct gdbarch gdbarch,
struct value function,
struct type valtype,
struct regcache regcache,
gdb_byte readbuf,
const gdb_byte writebuf 
) [static]
static void ia64_set_function_addr ( struct regcache regcache,
CORE_ADDR  func_addr 
) [static]

Definition at line 3706 of file ia64-tdep.c.

static struct ia64_frame_cache* ia64_sigtramp_frame_cache ( struct frame_info this_frame,
void **  this_cache 
) [static, read]
static void ia64_sigtramp_frame_init_saved_regs ( struct frame_info this_frame,
struct ia64_frame_cache cache 
) [static]
static struct value* ia64_sigtramp_frame_prev_register ( struct frame_info this_frame,
void **  this_cache,
int  regnum 
) [static, read]
static int ia64_sigtramp_frame_sniffer ( const struct frame_unwind self,
struct frame_info this_frame,
void **  this_cache 
) [static]
static void ia64_sigtramp_frame_this_id ( struct frame_info this_frame,
void **  this_cache,
struct frame_id this_id 
) [static]
static int ia64_size_of_register_frame ( struct frame_info this_frame,
ULONGEST  cfm 
) [static]

Definition at line 3950 of file ia64-tdep.c.

Referenced by ia64_gdbarch_init().

CORE_ADDR ia64_skip_prologue ( struct gdbarch gdbarch,
CORE_ADDR  pc 
)
static void ia64_store_argument_in_slot ( struct regcache regcache,
CORE_ADDR  bsp,
int  slotnum,
gdb_byte buf 
) [static]

Definition at line 3697 of file ia64-tdep.c.

References rse_address_add(), and write_memory().

static void ia64_store_return_value ( struct type type,
struct regcache regcache,
const gdb_byte valbuf 
) [static]
static int ia64_struct_type_p ( const struct type type) [static]

Definition at line 3215 of file ia64-tdep.c.

References TYPE_CODE, TYPE_CODE_STRUCT, and TYPE_CODE_UNION.

Referenced by ia64_extract_return_value(), and ia64_push_dummy_call().

static CORE_ADDR ia64_unwind_pc ( struct gdbarch gdbarch,
struct frame_info next_frame 
) [static]
static int ia64_use_struct_convention ( struct type type) [static]
static void ia64_value_to_register ( struct frame_info frame,
int  regnum,
struct type valtype,
const gdb_byte in 
) [static]
void ia64_write_pc ( struct regcache regcache,
CORE_ADDR  new_pc 
)
static struct type * is_float_or_hfa_type ( struct type t) [static, read]
static int is_float_or_hfa_type_recurse ( struct type t,
struct type **  etp 
) [static]
static CORE_ADDR refine_prologue_limit ( CORE_ADDR  pc,
CORE_ADDR  lim_pc,
int trust_limit 
) [static]
static void replace_bit_field ( gdb_byte bundle,
long long  val,
int  from,
int  len 
) [static]

Definition at line 409 of file ia64-tdep.c.

References len, and to.

Referenced by replace_slotN_contents().

static void replace_slotN_contents ( gdb_byte bundle,
long long  instr,
int  slotnum 
) [static]
static CORE_ADDR rse_address_add ( CORE_ADDR  addr,
int  nslots 
) [static]
static int slot_alignment_is_next_even ( struct type t) [static]
static long long slotN_contents ( gdb_byte bundle,
int  slotnum 
) [static]

Variable Documentation

struct floatformat floatformat_ia64_ext_big [static]
Initial value:
{
  floatformat_big, 82, 46, 47, 17, 65535, 0x1ffff, 64, 64,
  floatformat_intbit_yes, "floatformat_ia64_ext_big", floatformat_valid
}

Definition at line 297 of file ia64-tdep.c.

struct floatformat floatformat_ia64_ext_little [static]
Initial value:
{
  floatformat_little, 82, 0, 1, 17, 65535, 0x1ffff, 18, 64,
  floatformat_intbit_yes, "floatformat_ia64_ext_little", floatformat_valid, NULL
}

Definition at line 291 of file ia64-tdep.c.

struct floatformat* floatformats_ia64_ext[2] [static]
Initial value:

Definition at line 303 of file ia64-tdep.c.

Referenced by ia64_ext_type().

Definition at line 130 of file ia64-tdep.c.

Definition at line 121 of file ia64-tdep.c.

Referenced by ia64_gdbarch_init().

struct frame_base ia64_frame_base [static]
Initial value:

Definition at line 2379 of file ia64-tdep.c.

Definition at line 117 of file ia64-tdep.c.

Referenced by _initialize_ia64_tdep().

Definition at line 119 of file ia64-tdep.c.

Referenced by ia64_gdbarch_init().

char* ia64_register_names[] [static]

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

Referenced by ia64_register_name().

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

Referenced by ia64_gdbarch_init().

Definition at line 122 of file ia64-tdep.c.

Referenced by ia64_gdbarch_init().

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

Definition at line 1253 of file ia64-tdep.c.

Referenced by refine_prologue_limit().

Definition at line 129 of file ia64-tdep.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines