GDB (xrefs)
Classes | Macros | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/m88k-tdep.c File Reference
#include "defs.h"
#include "arch-utils.h"
#include "dis-asm.h"
#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
#include "gdbcore.h"
#include "gdbtypes.h"
#include "regcache.h"
#include "regset.h"
#include "symtab.h"
#include "trad-frame.h"
#include "value.h"
#include <algorithm>
#include "m88k-tdep.h"

Go to the source code of this file.

Classes

struct  m88k_frame_cache
 
struct  m88k_prologue_insn
 

Macros

#define BITMASK(pos, width)   (((0x1 << (width)) - 1) << (pos))
 
#define EXTRACT_FIELD(val, pos, width)   ((val) >> (pos) & BITMASK (0, width))
 
#define SUBU_OFFSET(x)   ((unsigned)(x & 0xFFFF))
 
#define ST_OFFSET(x)   ((unsigned)((x) & 0xFFFF))
 
#define ST_SRC(x)   EXTRACT_FIELD ((x), 21, 5)
 
#define ADDU_OFFSET(x)   ((unsigned)(x & 0xFFFF))
 

Enumerations

enum  m88k_prologue_insn_action {
  M88K_PIA_SKIP, M88K_PIA_NOTE_ST, M88K_PIA_NOTE_STD, M88K_PIA_NOTE_SP_ADJUSTMENT,
  M88K_PIA_NOTE_FP_ASSIGNMENT, M88K_PIA_NOTE_BRANCH, M88K_PIA_NOTE_PROLOGUE_END
}
 

Functions

static unsigned long m88k_fetch_instruction (CORE_ADDR pc, enum bfd_endian byte_order)
 
static const char * m88k_register_name (struct gdbarch *gdbarch, int regnum)
 
static struct typem88k_register_type (struct gdbarch *gdbarch, int regnum)
 
static CORE_ADDR m88k_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
 
typedef BP_MANIPULATION (m88k_break_insn)
 
static void m88k_write_pc (struct regcache *regcache, CORE_ADDR pc)
 
static int m88k_integral_or_pointer_p (const struct type *type)
 
static int m88k_floating_p (const struct type *type)
 
static int m88k_structure_or_union_p (const struct type *type)
 
static int m88k_8_byte_align_p (struct type *type)
 
static int m88k_in_register_p (struct type *type)
 
static CORE_ADDR m88k_store_arguments (struct regcache *regcache, int nargs, struct value **args, CORE_ADDR sp)
 
static CORE_ADDR m88k_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 m88k_dummy_id (struct gdbarch *arch, struct frame_info *this_frame)
 
static enum return_value_convention m88k_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
 
static CORE_ADDR m88k_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR limit, struct m88k_frame_cache *cache)
 
static CORE_ADDR m88k_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
 
static struct m88k_frame_cachem88k_frame_cache (struct frame_info *this_frame, void **this_cache)
 
static void m88k_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
 
static struct valuem88k_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum)
 
static CORE_ADDR m88k_frame_base_address (struct frame_info *this_frame, void **this_cache)
 
static void m88k_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len)
 
static void m88k_iterate_over_regset_sections (struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
 
static struct gdbarchm88k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
void _initialize_m88k_tdep (void)
 

Variables

constexpr gdb_byte m88k_break_insn [] = { 0xf0, 0x00, 0xd1, 0xff }
 
struct m88k_prologue_insn m88k_prologue_insn_table []
 
const int m88k_max_prologue_size = 128 * M88K_INSN_SIZE
 
static const struct frame_unwind m88k_frame_unwind
 
static const struct frame_base m88k_frame_base
 
static const struct regset m88k_gregset
 

Macro Definition Documentation

◆ ADDU_OFFSET

#define ADDU_OFFSET (   x)    ((unsigned)(x & 0xFFFF))

Definition at line 452 of file m88k-tdep.c.

Referenced by m88k_analyze_prologue().

◆ BITMASK

#define BITMASK (   pos,
  width 
)    (((0x1 << (width)) - 1) << (pos))

Definition at line 447 of file m88k-tdep.c.

◆ EXTRACT_FIELD

#define EXTRACT_FIELD (   val,
  pos,
  width 
)    ((val) >> (pos) & BITMASK (0, width))

Definition at line 448 of file m88k-tdep.c.

◆ ST_OFFSET

#define ST_OFFSET (   x)    ((unsigned)((x) & 0xFFFF))

Definition at line 450 of file m88k-tdep.c.

Referenced by m88k_analyze_prologue().

◆ ST_SRC

#define ST_SRC (   x)    EXTRACT_FIELD ((x), 21, 5)

Definition at line 451 of file m88k-tdep.c.

Referenced by m88k_analyze_prologue().

◆ SUBU_OFFSET

#define SUBU_OFFSET (   x)    ((unsigned)(x & 0xFFFF))

Definition at line 449 of file m88k-tdep.c.

Referenced by m88k_analyze_prologue().

Enumeration Type Documentation

◆ m88k_prologue_insn_action

Enumerator
M88K_PIA_SKIP 
M88K_PIA_NOTE_ST 
M88K_PIA_NOTE_STD 
M88K_PIA_NOTE_SP_ADJUSTMENT 
M88K_PIA_NOTE_FP_ASSIGNMENT 
M88K_PIA_NOTE_BRANCH 
M88K_PIA_NOTE_PROLOGUE_END 

Definition at line 457 of file m88k-tdep.c.

Function Documentation

◆ _initialize_m88k_tdep()

void _initialize_m88k_tdep ( void  )

Definition at line 866 of file m88k-tdep.c.

References gdbarch_register(), and m88k_gdbarch_init().

◆ BP_MANIPULATION()

typedef BP_MANIPULATION ( m88k_break_insn  )

◆ m88k_8_byte_align_p()

static int m88k_8_byte_align_p ( struct type type)
static

◆ m88k_addr_bits_remove()

static CORE_ADDR m88k_addr_bits_remove ( struct gdbarch gdbarch,
CORE_ADDR  addr 
)
static

Definition at line 87 of file m88k-tdep.c.

Referenced by BP_MANIPULATION(), and m88k_gdbarch_init().

◆ m88k_analyze_prologue()

static CORE_ADDR m88k_analyze_prologue ( struct gdbarch gdbarch,
CORE_ADDR  pc,
CORE_ADDR  limit,
struct m88k_frame_cache cache 
)
static

◆ m88k_dummy_id()

static struct frame_id m88k_dummy_id ( struct gdbarch arch,
struct frame_info this_frame 
)
static

◆ m88k_fetch_instruction()

static unsigned long m88k_fetch_instruction ( CORE_ADDR  pc,
enum bfd_endian  byte_order 
)
static

Definition at line 40 of file m88k-tdep.c.

References read_memory_unsigned_integer().

Referenced by m88k_analyze_prologue().

◆ m88k_floating_p()

static int m88k_floating_p ( const struct type type)
static

Definition at line 180 of file m88k-tdep.c.

References TYPE_CODE, TYPE_CODE_FLT, and TYPE_LENGTH.

Referenced by m88k_8_byte_align_p(), m88k_in_register_p(), and m88k_return_value().

◆ m88k_frame_base_address()

static CORE_ADDR m88k_frame_base_address ( struct frame_info this_frame,
void **  this_cache 
)
static

◆ m88k_frame_cache()

static struct m88k_frame_cache* m88k_frame_cache ( struct frame_info this_frame,
void **  this_cache 
)
static

◆ m88k_frame_prev_register()

static struct value* m88k_frame_prev_register ( struct frame_info this_frame,
void **  this_cache,
int  regnum 
)
static

◆ m88k_frame_this_id()

static void m88k_frame_this_id ( struct frame_info this_frame,
void **  this_cache,
struct frame_id this_id 
)
static

◆ m88k_gdbarch_init()

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

◆ m88k_in_register_p()

static int m88k_in_register_p ( struct type type)
static

◆ m88k_integral_or_pointer_p()

static int m88k_integral_or_pointer_p ( const struct type type)
static

◆ m88k_iterate_over_regset_sections()

static void m88k_iterate_over_regset_sections ( struct gdbarch gdbarch,
iterate_over_regset_sections_cb cb,
void *  cb_data,
const struct regcache regcache 
)
static

Definition at line 803 of file m88k-tdep.c.

References m88k_gregset, and M88K_NUM_REGS.

Referenced by m88k_gdbarch_init().

◆ m88k_push_dummy_call()

static CORE_ADDR m88k_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

◆ m88k_register_name()

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

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

References regnum.

Referenced by m88k_gdbarch_init().

◆ m88k_register_type()

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

◆ m88k_return_value()

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

◆ m88k_skip_prologue()

static CORE_ADDR m88k_skip_prologue ( struct gdbarch gdbarch,
CORE_ADDR  pc 
)
static

◆ m88k_store_arguments()

static CORE_ADDR m88k_store_arguments ( struct regcache regcache,
int  nargs,
struct value **  args,
CORE_ADDR  sp 
)
static

◆ m88k_structure_or_union_p()

static int m88k_structure_or_union_p ( const struct type type)
static

Definition at line 199 of file m88k-tdep.c.

References TYPE_CODE, TYPE_CODE_STRUCT, and TYPE_CODE_UNION.

Referenced by m88k_8_byte_align_p(), and m88k_in_register_p().

◆ m88k_supply_gregset()

static void m88k_supply_gregset ( const struct regset regset,
struct regcache regcache,
int  regnum,
const void *  gregs,
size_t  len 
)
static

Definition at line 778 of file m88k-tdep.c.

References M88K_NUM_REGS, regcache_raw_supply(), and regnum.

◆ m88k_write_pc()

static void m88k_write_pc ( struct regcache regcache,
CORE_ADDR  pc 
)
static

Variable Documentation

◆ m88k_break_insn

constexpr gdb_byte m88k_break_insn[] = { 0xf0, 0x00, 0xd1, 0xff }

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

◆ m88k_frame_base

const struct frame_base m88k_frame_base
static
Initial value:
=
{
}
static CORE_ADDR m88k_frame_base_address(struct frame_info *this_frame, void **this_cache)
Definition: m88k-tdep.c:752
static const struct frame_unwind m88k_frame_unwind
Definition: m88k-tdep.c:740

Definition at line 762 of file m88k-tdep.c.

Referenced by m88k_gdbarch_init().

◆ m88k_frame_unwind

const struct frame_unwind m88k_frame_unwind
static
Initial value:
=
{
NULL,
}
static struct value * m88k_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
Definition: m88k-tdep.c:715
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
Definition: frame-unwind.c:174
static void m88k_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
Definition: m88k-tdep.c:702
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
Definition: frame-unwind.c:184

Definition at line 740 of file m88k-tdep.c.

Referenced by m88k_gdbarch_init().

◆ m88k_gregset

const struct regset m88k_gregset
static
Initial value:
=
{
NULL,
}
static void m88k_supply_gregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len)
Definition: m88k-tdep.c:778

Definition at line 794 of file m88k-tdep.c.

Referenced by m88k_iterate_over_regset_sections().

◆ m88k_max_prologue_size

const int m88k_max_prologue_size = 128 * M88K_INSN_SIZE

Definition at line 619 of file m88k-tdep.c.

Referenced by m88k_skip_prologue().

◆ m88k_prologue_insn_table

struct m88k_prologue_insn m88k_prologue_insn_table[]

Definition at line 477 of file m88k-tdep.c.

Referenced by m88k_analyze_prologue().