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

Go to the source code of this file.

Classes

struct  m68k_frame_cache

Defines

#define P_LINKL_FP   0x480e
#define P_LINKW_FP   0x4e56
#define P_PEA_FP   0x4856
#define P_MOVEAL_SP_FP   0x2c4f
#define P_ADDAW_SP   0xdefc
#define P_ADDAL_SP   0xdffc
#define P_SUBQW_SP   0x514f
#define P_SUBQL_SP   0x518f
#define P_LEA_SP_SP   0x4fef
#define P_LEA_PC_A5   0x4bfb0170
#define P_FMOVEMX_SP   0xf227
#define P_MOVEL_SP   0x2f00
#define P_MOVEML_SP   0x48e7
#define SP_ARG0   (1 * 4)
#define BPT_VECTOR   0xf

Functions

static const gdb_bytem68k_local_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
static struct typem68k_ps_type (struct gdbarch *gdbarch)
static struct typem68881_ext_type (struct gdbarch *gdbarch)
static struct typem68k_register_type (struct gdbarch *gdbarch, int regnum)
static const char * m68k_register_name (struct gdbarch *gdbarch, int regnum)
static int m68k_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
static int m68k_register_to_value (struct frame_info *frame, int regnum, struct type *type, gdb_byte *to, int *optimizedp, int *unavailablep)
static void m68k_value_to_register (struct frame_info *frame, int regnum, struct type *type, const gdb_byte *from)
static void m68k_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf)
static void m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf)
static void m68k_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
static void m68k_svr4_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
static int m68k_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type)
static enum return_value_convention m68k_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static enum return_value_convention m68k_svr4_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static CORE_ADDR m68k_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
static CORE_ADDR m68k_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 m68k_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int num)
static struct m68k_frame_cachem68k_alloc_frame_cache (void)
static CORE_ADDR m68k_analyze_frame_setup (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, struct m68k_frame_cache *cache)
static CORE_ADDR m68k_analyze_register_saves (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, struct m68k_frame_cache *cache)
static CORE_ADDR m68k_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, struct m68k_frame_cache *cache)
static CORE_ADDR m68k_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
static CORE_ADDR m68k_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
static struct m68k_frame_cachem68k_frame_cache (struct frame_info *this_frame, void **this_cache)
static void m68k_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static struct valuem68k_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum)
static CORE_ADDR m68k_frame_base_address (struct frame_info *this_frame, void **this_cache)
static struct frame_id m68k_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
static int m68k_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
static int m68k_return_in_first_hidden_param_p (struct gdbarch *gdbarch, struct type *type)
void m68k_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
static struct gdbarchm68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
static void m68k_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
void _initialize_m68k_tdep (void)

Variables

static const char * m68k_register_names []
static struct frame_unwind m68k_frame_unwind
static struct frame_base m68k_frame_base
initialize_file_ftype _initialize_m68k_tdep

Define Documentation

#define BPT_VECTOR   0xf

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

Referenced by m68k_local_breakpoint_from_pc().

#define P_ADDAL_SP   0xdffc

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

Referenced by m68k_analyze_frame_setup().

#define P_ADDAW_SP   0xdefc

Definition at line 45 of file m68k-tdep.c.

Referenced by m68k_analyze_frame_setup().

#define P_FMOVEMX_SP   0xf227

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

Referenced by m68k_analyze_register_saves().

#define P_LEA_PC_A5   0x4bfb0170

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

Referenced by m68k_analyze_prologue().

#define P_LEA_SP_SP   0x4fef

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

Referenced by m68k_analyze_frame_setup().

#define P_LINKL_FP   0x480e

Definition at line 41 of file m68k-tdep.c.

Referenced by m68k_analyze_frame_setup().

#define P_LINKW_FP   0x4e56

Definition at line 42 of file m68k-tdep.c.

Referenced by m68k_analyze_frame_setup().

#define P_MOVEAL_SP_FP   0x2c4f

Definition at line 44 of file m68k-tdep.c.

Referenced by m68k_analyze_frame_setup().

#define P_MOVEL_SP   0x2f00

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

Referenced by m68k_analyze_register_saves().

#define P_MOVEML_SP   0x48e7

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

Referenced by m68k_analyze_register_saves().

#define P_PEA_FP   0x4856

Definition at line 43 of file m68k-tdep.c.

Referenced by m68k_analyze_frame_setup().

#define P_SUBQL_SP   0x518f

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

Referenced by m68k_analyze_frame_setup().

#define P_SUBQW_SP   0x514f

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

Referenced by m68k_analyze_frame_setup().

#define SP_ARG0   (1 * 4)

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

Referenced by m68k_get_longjmp_target().


Function Documentation

void _initialize_m68k_tdep ( void  )

Definition at line 1301 of file m68k-tdep.c.

References gdbarch_register(), m68k_dump_tdep(), and m68k_gdbarch_init().

static struct type* m68881_ext_type ( struct gdbarch gdbarch) [static, read]
static struct m68k_frame_cache* m68k_alloc_frame_cache ( void  ) [static, read]
static CORE_ADDR m68k_analyze_frame_setup ( struct gdbarch gdbarch,
CORE_ADDR  pc,
CORE_ADDR  current_pc,
struct m68k_frame_cache cache 
) [static]
static CORE_ADDR m68k_analyze_prologue ( struct gdbarch gdbarch,
CORE_ADDR  pc,
CORE_ADDR  current_pc,
struct m68k_frame_cache cache 
) [static]
static CORE_ADDR m68k_analyze_register_saves ( struct gdbarch gdbarch,
CORE_ADDR  pc,
CORE_ADDR  current_pc,
struct m68k_frame_cache cache 
) [static]
static int m68k_convert_register_p ( struct gdbarch gdbarch,
int  regnum,
struct type type 
) [static]

Definition at line 192 of file m68k-tdep.c.

References gdbarch_tdep::fpregs_present, M68K_FP0_REGNUM, and register_type().

Referenced by m68k_gdbarch_init().

static struct frame_id m68k_dummy_id ( struct gdbarch gdbarch,
struct frame_info this_frame 
) [static, read]
static void m68k_dump_tdep ( struct gdbarch gdbarch,
struct ui_file file 
) [static]

Definition at line 1290 of file m68k-tdep.c.

References gdbarch_tdep().

Referenced by _initialize_m68k_tdep().

static int m68k_dwarf_reg_to_regnum ( struct gdbarch gdbarch,
int  num 
) [static]
static void m68k_extract_return_value ( struct type type,
struct regcache regcache,
gdb_byte valbuf 
) [static]
static CORE_ADDR m68k_frame_align ( struct gdbarch gdbarch,
CORE_ADDR  sp 
) [static]

Definition at line 498 of file m68k-tdep.c.

Referenced by m68k_gdbarch_init().

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

Definition at line 985 of file m68k-tdep.c.

References m68k_frame_cache::base, and m68k_frame_cache().

static struct m68k_frame_cache* m68k_frame_cache ( struct frame_info this_frame,
void **  this_cache 
) [static, read]
static struct value* m68k_frame_prev_register ( struct frame_info this_frame,
void **  this_cache,
int  regnum 
) [static, read]
static void m68k_frame_this_id ( struct frame_info this_frame,
void **  this_cache,
struct frame_id this_id 
) [static]
static struct gdbarch* m68k_gdbarch_init ( struct gdbarch_info  info,
struct gdbarch_list arches 
) [static, read]

Definition at line 1084 of file m68k-tdep.c.

References gdbarch_info::bfd_arch_info, core_addr_lessthan(), dwarf2_append_unwinders(), gdbarch_tdep::flavour, gdbarch_tdep::float_return, floatformats_ieee_double, floatformats_m68881_ext, gdbarch_tdep::fpregs_present, frame_base_set_default(), frame_unwind_append_unwinder(), gdbarch_list::gdbarch, gdbarch_alloc(), gdbarch_init_osabi(), gdbarch_list_lookup_by_info(), gdbarch_tdep::jb_elt_size, gdbarch_tdep::jb_pc, M68K_A1_REGNUM, m68k_coldfire_flavour, m68k_convert_register_p(), m68k_dummy_id(), m68k_dwarf_reg_to_regnum(), m68k_fido_flavour, M68K_FP0_REGNUM, M68K_FPI_REGNUM, m68k_frame_align(), m68k_get_longjmp_target(), m68k_local_breakpoint_from_pc(), m68k_no_flavour, M68K_NUM_REGS, M68K_PC_REGNUM, M68K_PS_REGNUM, m68k_push_dummy_call(), m68k_register_name(), m68k_register_to_value(), m68k_register_type(), m68k_return_in_first_hidden_param_p(), m68k_return_value(), m68k_skip_prologue(), M68K_SP_REGNUM, m68k_unwind_pc(), m68k_value_to_register(), gdbarch_list::next, reg_struct_return, set_gdbarch_believe_pcc_promotion(), set_gdbarch_breakpoint_from_pc(), set_gdbarch_convert_register_p(), set_gdbarch_decr_pc_after_break(), set_gdbarch_dummy_id(), set_gdbarch_dwarf2_reg_to_regnum(), set_gdbarch_fp0_regnum(), set_gdbarch_frame_align(), set_gdbarch_frame_args_skip(), set_gdbarch_get_longjmp_target(), set_gdbarch_inner_than(), set_gdbarch_long_double_bit(), set_gdbarch_long_double_format(), set_gdbarch_num_regs(), set_gdbarch_pc_regnum(), set_gdbarch_print_insn(), set_gdbarch_ps_regnum(), set_gdbarch_push_dummy_call(), set_gdbarch_register_name(), set_gdbarch_register_to_value(), set_gdbarch_register_type(), set_gdbarch_return_in_first_hidden_param_p(), set_gdbarch_return_value(), set_gdbarch_skip_prologue(), set_gdbarch_sp_regnum(), set_gdbarch_unwind_pc(), set_gdbarch_value_to_register(), gdbarch_tdep::struct_return, gdbarch_tdep::struct_value_regnum, gdbarch_info::target_desc, tdesc_data, tdesc_data_alloc(), tdesc_data_cleanup(), tdesc_find_feature(), tdesc_has_registers(), tdesc_numbered_register(), tdesc_use_registers(), and xzalloc().

Referenced by _initialize_m68k_tdep().

static int m68k_get_longjmp_target ( struct frame_info frame,
CORE_ADDR pc 
) [static]
static const gdb_byte* m68k_local_breakpoint_from_pc ( struct gdbarch gdbarch,
CORE_ADDR pcptr,
int lenptr 
) [static]

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

References BPT_VECTOR.

Referenced by m68k_gdbarch_init().

static struct type* m68k_ps_type ( struct gdbarch gdbarch) [static, read]
static CORE_ADDR m68k_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 m68k_reg_struct_return_p ( struct gdbarch gdbarch,
struct type type 
) [static]
static const char* m68k_register_name ( struct gdbarch gdbarch,
int  regnum 
) [static]
static int m68k_register_to_value ( struct frame_info frame,
int  regnum,
struct type type,
gdb_byte to,
int optimizedp,
int unavailablep 
) [static]
static struct type* m68k_register_type ( struct gdbarch gdbarch,
int  regnum 
) [static, read]
static int m68k_return_in_first_hidden_param_p ( struct gdbarch gdbarch,
struct type type 
) [static]

Definition at line 1058 of file m68k-tdep.c.

Referenced by m68k_gdbarch_init().

static enum return_value_convention m68k_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 m68k_skip_prologue ( struct gdbarch gdbarch,
CORE_ADDR  start_pc 
) [static]

Definition at line 854 of file m68k-tdep.c.

References m68k_frame_cache::locals, m68k_analyze_prologue(), and m68k_frame_cache::pc.

Referenced by m68k_gdbarch_init().

static void m68k_store_return_value ( struct type type,
struct regcache regcache,
const gdb_byte valbuf 
) [static]
static void m68k_svr4_extract_return_value ( struct type type,
struct regcache regcache,
gdb_byte valbuf 
) [static]
void m68k_svr4_init_abi ( struct gdbarch_info  info,
struct gdbarch gdbarch 
)
static enum return_value_convention m68k_svr4_return_value ( struct gdbarch gdbarch,
struct value function,
struct type type,
struct regcache regcache,
gdb_byte readbuf,
const gdb_byte writebuf 
) [static]
static void m68k_svr4_store_return_value ( struct type type,
struct regcache regcache,
const gdb_byte valbuf 
) [static]
static CORE_ADDR m68k_unwind_pc ( struct gdbarch gdbarch,
struct frame_info next_frame 
) [static]

Definition at line 867 of file m68k-tdep.c.

References extract_typed_address(), frame_unwind_register(), and gdbarch_pc_regnum().

Referenced by m68k_gdbarch_init().

static void m68k_value_to_register ( struct frame_info frame,
int  regnum,
struct type type,
const gdb_byte from 
) [static]

Variable Documentation

Referenced by initialize_all_files().

struct frame_base m68k_frame_base [static]
Initial value:

Definition at line 992 of file m68k-tdep.c.

const char* m68k_register_names[] [static]
Initial value:
 {
    "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
    "a0", "a1", "a2", "a3", "a4", "a5", "fp", "sp",
    "ps", "pc",
    "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7",
    "fpcontrol", "fpstatus", "fpiaddr"
  }

Definition at line 163 of file m68k-tdep.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines