GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
iq2000-tdep.c File Reference
#include "defs.h"
#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
#include "dwarf2/frame.h"
#include "gdbtypes.h"
#include "value.h"
#include "dis-asm.h"
#include "arch-utils.h"
#include "regcache.h"
#include "osabi.h"
#include "gdbcore.h"

Go to the source code of this file.

Classes

struct  iq2000_frame_cache
 

Macros

#define INSN_IS_ADDIU(X)   (((X) & 0xfc000000) == 0x24000000)
 
#define ADDIU_REG_SRC(X)   (((X) & 0x03e00000) >> 21)
 
#define ADDIU_REG_TGT(X)   (((X) & 0x001f0000) >> 16)
 
#define ADDIU_IMMEDIATE(X)   ((signed short) ((X) & 0x0000ffff))
 
#define INSN_IS_MOVE(X)   (((X) & 0xffe007ff) == 0x00000025)
 
#define MOVE_REG_SRC(X)   (((X) & 0x001f0000) >> 16)
 
#define MOVE_REG_TGT(X)   (((X) & 0x0000f800) >> 11)
 
#define INSN_IS_STORE_WORD(X)   (((X) & 0xfc000000) == 0xac000000)
 
#define SW_REG_INDEX(X)   (((X) & 0x03e00000) >> 21)
 
#define SW_REG_SRC(X)   (((X) & 0x001f0000) >> 16)
 
#define SW_OFFSET(X)   ((signed short) ((X) & 0x0000ffff))
 

Enumerations

enum  gdb_regnum {
  E_R0_REGNUM , E_R1_REGNUM , E_R2_REGNUM , E_R3_REGNUM ,
  E_R4_REGNUM , E_R5_REGNUM , E_R6_REGNUM , E_R7_REGNUM ,
  E_R8_REGNUM , E_R9_REGNUM , E_R10_REGNUM , E_R11_REGNUM ,
  E_R12_REGNUM , E_R13_REGNUM , E_R14_REGNUM , E_R15_REGNUM ,
  E_R16_REGNUM , E_R17_REGNUM , E_R18_REGNUM , E_R19_REGNUM ,
  E_R20_REGNUM , E_R21_REGNUM , E_R22_REGNUM , E_R23_REGNUM ,
  E_R24_REGNUM , E_R25_REGNUM , E_R26_REGNUM , E_R27_REGNUM ,
  E_R28_REGNUM , E_R29_REGNUM , E_R30_REGNUM , E_R31_REGNUM ,
  E_PC_REGNUM , E_LR_REGNUM = E_R31_REGNUM , E_SP_REGNUM = E_R29_REGNUM , E_FP_REGNUM = E_R27_REGNUM ,
  E_FN_RETURN_REGNUM = E_R2_REGNUM , E_1ST_ARGREG = E_R4_REGNUM , E_LAST_ARGREG = E_R11_REGNUM , E_NUM_REGS = E_PC_REGNUM + 1
}
 
enum  { REG_UNAVAIL = (CORE_ADDR) -1 }
 

Functions

static CORE_ADDR insn_ptr_from_addr (CORE_ADDR addr)
 
static CORE_ADDR insn_addr_from_ptr (CORE_ADDR ptr)
 
static CORE_ADDR iq2000_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
 
static void iq2000_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
 
static const char * iq2000_register_name (struct gdbarch *gdbarch, int regnum)
 
static struct symtab_and_line find_last_line_symbol (CORE_ADDR start, CORE_ADDR end, int notcurrent)
 
static CORE_ADDR iq2000_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR scan_start, CORE_ADDR scan_end, frame_info_ptr fi, struct iq2000_frame_cache *cache)
 
static void iq2000_init_frame_cache (struct iq2000_frame_cache *cache)
 
static CORE_ADDR iq2000_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
 
static struct iq2000_frame_cache * iq2000_frame_cache (frame_info_ptr this_frame, void **this_cache)
 
static struct valueiq2000_frame_prev_register (frame_info_ptr this_frame, void **this_cache, int regnum)
 
static void iq2000_frame_this_id (frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
 
static CORE_ADDR iq2000_frame_base_address (frame_info_ptr this_frame, void **this_cache)
 
static int iq2000_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
 
static const gdb_byte * iq2000_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
 
static void iq2000_store_return_value (struct type *type, struct regcache *regcache, const void *valbuf)
 
static int iq2000_use_struct_convention (struct type *type)
 
static void iq2000_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf)
 
static enum return_value_convention iq2000_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
 
static struct typeiq2000_register_type (struct gdbarch *gdbarch, int regnum)
 
static CORE_ADDR iq2000_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
 
static int iq2000_pass_8bytetype_by_address (struct type *type)
 
static CORE_ADDR iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr)
 
static struct gdbarchiq2000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
void _initialize_iq2000_tdep ()
 

Variables

static const struct frame_unwind iq2000_frame_unwind
 
static const struct frame_base iq2000_frame_base
 

Macro Definition Documentation

◆ ADDIU_IMMEDIATE

#define ADDIU_IMMEDIATE ( X)    ((signed short) ((X) & 0x0000ffff))

Definition at line 148 of file iq2000-tdep.c.

Referenced by iq2000_scan_prologue().

◆ ADDIU_REG_SRC

#define ADDIU_REG_SRC ( X)    (((X) & 0x03e00000) >> 21)

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

Referenced by iq2000_scan_prologue().

◆ ADDIU_REG_TGT

#define ADDIU_REG_TGT ( X)    (((X) & 0x001f0000) >> 16)

Definition at line 147 of file iq2000-tdep.c.

Referenced by iq2000_scan_prologue().

◆ INSN_IS_ADDIU

#define INSN_IS_ADDIU ( X)    (((X) & 0xfc000000) == 0x24000000)

Definition at line 145 of file iq2000-tdep.c.

Referenced by iq2000_scan_prologue().

◆ INSN_IS_MOVE

#define INSN_IS_MOVE ( X)    (((X) & 0xffe007ff) == 0x00000025)

Definition at line 151 of file iq2000-tdep.c.

Referenced by iq2000_scan_prologue().

◆ INSN_IS_STORE_WORD

#define INSN_IS_STORE_WORD ( X)    (((X) & 0xfc000000) == 0xac000000)

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

Referenced by iq2000_scan_prologue().

◆ MOVE_REG_SRC

#define MOVE_REG_SRC ( X)    (((X) & 0x001f0000) >> 16)

Definition at line 152 of file iq2000-tdep.c.

Referenced by iq2000_scan_prologue().

◆ MOVE_REG_TGT

#define MOVE_REG_TGT ( X)    (((X) & 0x0000f800) >> 11)

Definition at line 153 of file iq2000-tdep.c.

Referenced by iq2000_scan_prologue().

◆ SW_OFFSET

#define SW_OFFSET ( X)    ((signed short) ((X) & 0x0000ffff))

Definition at line 159 of file iq2000-tdep.c.

Referenced by iq2000_scan_prologue().

◆ SW_REG_INDEX

#define SW_REG_INDEX ( X)    (((X) & 0x03e00000) >> 21)

Definition at line 157 of file iq2000-tdep.c.

Referenced by iq2000_scan_prologue().

◆ SW_REG_SRC

#define SW_REG_SRC ( X)    (((X) & 0x001f0000) >> 16)

Definition at line 158 of file iq2000-tdep.c.

Referenced by iq2000_scan_prologue().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
REG_UNAVAIL 

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

◆ gdb_regnum

enum gdb_regnum
Enumerator
E_R0_REGNUM 
E_R1_REGNUM 
E_R2_REGNUM 
E_R3_REGNUM 
E_R4_REGNUM 
E_R5_REGNUM 
E_R6_REGNUM 
E_R7_REGNUM 
E_R8_REGNUM 
E_R9_REGNUM 
E_R10_REGNUM 
E_R11_REGNUM 
E_R12_REGNUM 
E_R13_REGNUM 
E_R14_REGNUM 
E_R15_REGNUM 
E_R16_REGNUM 
E_R17_REGNUM 
E_R18_REGNUM 
E_R19_REGNUM 
E_R20_REGNUM 
E_R21_REGNUM 
E_R22_REGNUM 
E_R23_REGNUM 
E_R24_REGNUM 
E_R25_REGNUM 
E_R26_REGNUM 
E_R27_REGNUM 
E_R28_REGNUM 
E_R29_REGNUM 
E_R30_REGNUM 
E_R31_REGNUM 
E_PC_REGNUM 
E_LR_REGNUM 
E_SP_REGNUM 
E_FP_REGNUM 
E_FN_RETURN_REGNUM 
E_1ST_ARGREG 
E_LAST_ARGREG 
E_NUM_REGS 

Definition at line 36 of file iq2000-tdep.c.

Function Documentation

◆ _initialize_iq2000_tdep()

void _initialize_iq2000_tdep ( )

Definition at line 844 of file iq2000-tdep.c.

References gdbarch_register(), and iq2000_gdbarch_init().

◆ find_last_line_symbol()

static struct symtab_and_line find_last_line_symbol ( CORE_ADDR start,
CORE_ADDR end,
int notcurrent )
static

◆ insn_addr_from_ptr()

static CORE_ADDR insn_addr_from_ptr ( CORE_ADDR ptr)
static

Definition at line 79 of file iq2000-tdep.c.

Referenced by iq2000_pointer_to_address().

◆ insn_ptr_from_addr()

static CORE_ADDR insn_ptr_from_addr ( CORE_ADDR addr)
static

Definition at line 73 of file iq2000-tdep.c.

Referenced by iq2000_address_to_pointer().

◆ iq2000_address_to_pointer()

static void iq2000_address_to_pointer ( struct gdbarch * gdbarch,
struct type * type,
gdb_byte * buf,
CORE_ADDR addr )
static

◆ iq2000_breakpoint_kind_from_pc()

static int iq2000_breakpoint_kind_from_pc ( struct gdbarch * gdbarch,
CORE_ADDR * pcptr )
static

Definition at line 454 of file iq2000-tdep.c.

Referenced by iq2000_gdbarch_init().

◆ iq2000_extract_return_value()

static void iq2000_extract_return_value ( struct type * type,
struct regcache * regcache,
gdb_byte * valbuf )
static

◆ iq2000_frame_align()

static CORE_ADDR iq2000_frame_align ( struct gdbarch * ignore,
CORE_ADDR sp )
static

Definition at line 586 of file iq2000-tdep.c.

Referenced by iq2000_gdbarch_init().

◆ iq2000_frame_base_address()

static CORE_ADDR iq2000_frame_base_address ( frame_info_ptr this_frame,
void ** this_cache )
static

Definition at line 438 of file iq2000-tdep.c.

References iq2000_frame_cache::base, and iq2000_frame_cache().

◆ iq2000_frame_cache()

static struct iq2000_frame_cache * iq2000_frame_cache ( frame_info_ptr this_frame,
void ** this_cache )
static

◆ iq2000_frame_prev_register()

static struct value * iq2000_frame_prev_register ( frame_info_ptr this_frame,
void ** this_cache,
int regnum )
static

◆ iq2000_frame_this_id()

static void iq2000_frame_this_id ( frame_info_ptr this_frame,
void ** this_cache,
struct frame_id * this_id )
static

◆ iq2000_gdbarch_init()

static struct gdbarch * iq2000_gdbarch_init ( struct gdbarch_info info,
struct gdbarch_list * arches )
static

◆ iq2000_init_frame_cache()

static void iq2000_init_frame_cache ( struct iq2000_frame_cache * cache)
static

◆ iq2000_pass_8bytetype_by_address()

static int iq2000_pass_8bytetype_by_address ( struct type * type)
static

◆ iq2000_pointer_to_address()

static CORE_ADDR iq2000_pointer_to_address ( struct gdbarch * gdbarch,
struct type * type,
const gdb_byte * buf )
static

◆ iq2000_push_dummy_call()

static CORE_ADDR iq2000_push_dummy_call ( struct gdbarch * gdbarch,
struct value * function,
struct regcache * regcache,
CORE_ADDR bp_addr,
int nargs,
struct value ** args,
CORE_ADDR sp,
function_call_return_method return_method,
CORE_ADDR struct_addr )
static

◆ iq2000_register_name()

static const char * iq2000_register_name ( struct gdbarch * gdbarch,
int regnum )
static

Definition at line 125 of file iq2000-tdep.c.

References E_NUM_REGS, gdb_static_assert(), and regnum.

Referenced by iq2000_gdbarch_init().

◆ iq2000_register_type()

static struct type * iq2000_register_type ( struct gdbarch * gdbarch,
int regnum )
static

Definition at line 580 of file iq2000-tdep.c.

References builtin_type::builtin_int32, and builtin_type().

Referenced by iq2000_gdbarch_init().

◆ iq2000_return_value()

static enum return_value_convention iq2000_return_value ( struct gdbarch * gdbarch,
struct value * function,
struct type * type,
struct regcache * regcache,
gdb_byte * readbuf,
const gdb_byte * writebuf )
static

◆ iq2000_scan_prologue()

static CORE_ADDR iq2000_scan_prologue ( struct gdbarch * gdbarch,
CORE_ADDR scan_start,
CORE_ADDR scan_end,
frame_info_ptr fi,
struct iq2000_frame_cache * cache )
static

◆ iq2000_skip_prologue()

static CORE_ADDR iq2000_skip_prologue ( struct gdbarch * gdbarch,
CORE_ADDR pc )
static

◆ iq2000_store_return_value()

static void iq2000_store_return_value ( struct type * type,
struct regcache * regcache,
const void * valbuf )
static

Definition at line 481 of file iq2000-tdep.c.

References E_FN_RETURN_REGNUM, type::length(), regcache::raw_write(), and size.

Referenced by iq2000_return_value().

◆ iq2000_sw_breakpoint_from_kind()

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

Definition at line 464 of file iq2000-tdep.c.

References big_breakpoint, gdbarch_byte_order(), little_breakpoint, and size.

Referenced by iq2000_gdbarch_init().

◆ iq2000_use_struct_convention()

static int iq2000_use_struct_convention ( struct type * type)
static

Definition at line 505 of file iq2000-tdep.c.

References type::code(), and type::length().

Referenced by iq2000_return_value().

Variable Documentation

◆ iq2000_frame_base

const struct frame_base iq2000_frame_base
static
Initial value:
= {
}
static const struct frame_unwind iq2000_frame_unwind
static CORE_ADDR iq2000_frame_base_address(frame_info_ptr this_frame, void **this_cache)

Definition at line 446 of file iq2000-tdep.c.

Referenced by iq2000_gdbarch_init().

◆ iq2000_frame_unwind

const struct frame_unwind iq2000_frame_unwind
static
Initial value:
= {
"iq2000 prologue",
NULL,
}
int default_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
enum unwind_stop_reason default_frame_unwind_stop_reason(frame_info_ptr this_frame, void **this_cache)
@ NORMAL_FRAME
Definition frame.h:187
static struct value * iq2000_frame_prev_register(frame_info_ptr this_frame, void **this_cache, int regnum)
static void iq2000_frame_this_id(frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)

Definition at line 427 of file iq2000-tdep.c.

Referenced by iq2000_gdbarch_init().