GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
msp430-tdep.c File Reference
#include "defs.h"
#include "arch-utils.h"
#include "prologue-value.h"
#include "target.h"
#include "regcache.h"
#include "dis-asm.h"
#include "gdbtypes.h"
#include "frame.h"
#include "frame-unwind.h"
#include "frame-base.h"
#include "value.h"
#include "gdbcore.h"
#include "dwarf2/frame.h"
#include "reggroups.h"
#include "gdbarch.h"
#include "elf/msp430.h"
#include "opcode/msp430-decode.h"
#include "elf-bfd.h"

Go to the source code of this file.

Classes

struct  msp430_gdbarch_tdep
 
struct  msp430_prologue
 

Enumerations

enum  {
  MSP430_PC_RAW_REGNUM , MSP430_SP_RAW_REGNUM , MSP430_SR_RAW_REGNUM , MSP430_CG_RAW_REGNUM ,
  MSP430_R4_RAW_REGNUM , MSP430_R5_RAW_REGNUM , MSP430_R6_RAW_REGNUM , MSP430_R7_RAW_REGNUM ,
  MSP430_R8_RAW_REGNUM , MSP430_R9_RAW_REGNUM , MSP430_R10_RAW_REGNUM , MSP430_R11_RAW_REGNUM ,
  MSP430_R12_RAW_REGNUM , MSP430_R13_RAW_REGNUM , MSP430_R14_RAW_REGNUM , MSP430_R15_RAW_REGNUM ,
  MSP430_NUM_REGS , MSP430_PC_REGNUM = MSP430_NUM_REGS , MSP430_SP_REGNUM , MSP430_SR_REGNUM ,
  MSP430_CG_REGNUM , MSP430_R4_REGNUM , MSP430_R5_REGNUM , MSP430_R6_REGNUM ,
  MSP430_R7_REGNUM , MSP430_R8_REGNUM , MSP430_R9_REGNUM , MSP430_R10_REGNUM ,
  MSP430_R11_REGNUM , MSP430_R12_REGNUM , MSP430_R13_REGNUM , MSP430_R14_REGNUM ,
  MSP430_R15_REGNUM , MSP430_NUM_TOTAL_REGS , MSP430_NUM_PSEUDO_REGS = MSP430_NUM_TOTAL_REGS - MSP430_NUM_REGS
}
 
enum  { MSP_ISA_MSP430 , MSP_ISA_MSP430X }
 
enum  { MSP_SMALL_CODE_MODEL , MSP_LARGE_CODE_MODEL }
 

Functions

static struct typemsp430_register_type (struct gdbarch *gdbarch, int reg_nr)
 
static struct typemsp430x_register_type (struct gdbarch *gdbarch, int reg_nr)
 
static const char * msp430_register_name (struct gdbarch *gdbarch, int regnr)
 
static int msp430_register_reggroup_p (struct gdbarch *gdbarch, int regnum, const struct reggroup *group)
 
static enum register_status msp430_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, int regnum, gdb_byte *buffer)
 
static void msp430_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int regnum, const gdb_byte *buffer)
 
static int msp430_register_sim_regno (struct gdbarch *gdbarch, int regnum)
 
typedef BP_MANIPULATION (msp430_break_insn)
 
static int msp430_get_opcode_byte (void *handle)
 
static void check_for_saved (void *result_untyped, pv_t addr, CORE_ADDR size, pv_t value)
 
static void msp430_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc, CORE_ADDR limit_pc, struct msp430_prologue *result)
 
static CORE_ADDR msp430_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
 
static struct msp430_prologuemsp430_analyze_frame_prologue (frame_info_ptr this_frame, void **this_prologue_cache)
 
static CORE_ADDR msp430_frame_base (frame_info_ptr this_frame, void **this_prologue_cache)
 
static void msp430_this_id (frame_info_ptr this_frame, void **this_prologue_cache, struct frame_id *this_id)
 
static struct valuemsp430_prev_register (frame_info_ptr this_frame, void **this_prologue_cache, int regnum)
 
static int msp430_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg)
 
static enum return_value_convention msp430_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
 
static CORE_ADDR msp430_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
 
static CORE_ADDR msp430_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 int msp430_in_return_stub (struct gdbarch *gdbarch, CORE_ADDR pc, const char *name)
 
static CORE_ADDR msp430_skip_trampoline_code (frame_info_ptr frame, CORE_ADDR pc)
 
static struct gdbarchmsp430_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
void _initialize_msp430_tdep ()
 

Variables

constexpr gdb_byte msp430_break_insn [] = { 0x43, 0x43 }
 
static const struct frame_unwind msp430_unwind
 
static const char msp430_epilog_name_prefix [] = "__mspabi_func_epilog_"
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MSP430_PC_RAW_REGNUM 
MSP430_SP_RAW_REGNUM 
MSP430_SR_RAW_REGNUM 
MSP430_CG_RAW_REGNUM 
MSP430_R4_RAW_REGNUM 
MSP430_R5_RAW_REGNUM 
MSP430_R6_RAW_REGNUM 
MSP430_R7_RAW_REGNUM 
MSP430_R8_RAW_REGNUM 
MSP430_R9_RAW_REGNUM 
MSP430_R10_RAW_REGNUM 
MSP430_R11_RAW_REGNUM 
MSP430_R12_RAW_REGNUM 
MSP430_R13_RAW_REGNUM 
MSP430_R14_RAW_REGNUM 
MSP430_R15_RAW_REGNUM 
MSP430_NUM_REGS 
MSP430_PC_REGNUM 
MSP430_SP_REGNUM 
MSP430_SR_REGNUM 
MSP430_CG_REGNUM 
MSP430_R4_REGNUM 
MSP430_R5_REGNUM 
MSP430_R6_REGNUM 
MSP430_R7_REGNUM 
MSP430_R8_REGNUM 
MSP430_R9_REGNUM 
MSP430_R10_REGNUM 
MSP430_R11_REGNUM 
MSP430_R12_REGNUM 
MSP430_R13_REGNUM 
MSP430_R14_REGNUM 
MSP430_R15_REGNUM 
MSP430_NUM_TOTAL_REGS 
MSP430_NUM_PSEUDO_REGS 

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

◆ anonymous enum

anonymous enum
Enumerator
MSP_ISA_MSP430 
MSP_ISA_MSP430X 

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

◆ anonymous enum

anonymous enum
Enumerator
MSP_SMALL_CODE_MODEL 
MSP_LARGE_CODE_MODEL 

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

Function Documentation

◆ _initialize_msp430_tdep()

void _initialize_msp430_tdep ( )

Definition at line 999 of file msp430-tdep.c.

References gdbarch_register(), and msp430_gdbarch_init().

◆ BP_MANIPULATION()

typedef BP_MANIPULATION ( msp430_break_insn )

Definition at line 283 of file msp430-tdep.c.

◆ check_for_saved()

static void check_for_saved ( void * result_untyped,
pv_t addr,
CORE_ADDR size,
pv_t value )
static

◆ msp430_analyze_frame_prologue()

static struct msp430_prologue * msp430_analyze_frame_prologue ( frame_info_ptr this_frame,
void ** this_prologue_cache )
static

◆ msp430_analyze_prologue()

static void msp430_analyze_prologue ( struct gdbarch * gdbarch,
CORE_ADDR start_pc,
CORE_ADDR limit_pc,
struct msp430_prologue * result )
static

◆ msp430_dwarf2_reg_to_regnum()

static int msp430_dwarf2_reg_to_regnum ( struct gdbarch * gdbarch,
int reg )
static

Definition at line 557 of file msp430-tdep.c.

References MSP430_NUM_REGS.

Referenced by msp430_gdbarch_init().

◆ msp430_frame_align()

static CORE_ADDR msp430_frame_align ( struct gdbarch * gdbarch,
CORE_ADDR sp )
static

Definition at line 638 of file msp430-tdep.c.

Referenced by msp430_gdbarch_init().

◆ msp430_frame_base()

static CORE_ADDR msp430_frame_base ( frame_info_ptr this_frame,
void ** this_prologue_cache )
static

◆ msp430_gdbarch_init()

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

Definition at line 836 of file msp430-tdep.c.

References arches, msp430_gdbarch_tdep::code_model, core_addr_lessthan(), dwarf2_append_unwinders(), msp430_gdbarch_tdep::elf_flags, floatformats_ieee_double, floatformats_ieee_single, frame_unwind_append_unwinder(), gdbarch_alloc(), gdbarch_bfd_arch_info(), gdbarch_list_lookup_by_info(), get_current_arch(), gdbarch::info(), msp430_gdbarch_tdep::isa, msp430_dwarf2_reg_to_regnum(), msp430_frame_align(), msp430_in_return_stub(), MSP430_NUM_PSEUDO_REGS, MSP430_NUM_REGS, MSP430_PC_REGNUM, msp430_pseudo_register_read(), msp430_pseudo_register_write(), msp430_push_dummy_call(), msp430_register_name(), msp430_register_reggroup_p(), msp430_register_sim_regno(), msp430_register_type(), msp430_return_value(), msp430_skip_prologue(), msp430_skip_trampoline_code(), MSP430_SP_REGNUM, msp430_unwind, msp430x_register_type(), MSP_ISA_MSP430, MSP_ISA_MSP430X, MSP_LARGE_CODE_MODEL, MSP_SMALL_CODE_MODEL, set_gdbarch_addr_bit(), set_gdbarch_breakpoint_kind_from_pc(), set_gdbarch_char_signed(), set_gdbarch_decr_pc_after_break(), set_gdbarch_double_bit(), set_gdbarch_double_format(), set_gdbarch_dwarf2_addr_size(), set_gdbarch_dwarf2_reg_to_regnum(), set_gdbarch_float_bit(), set_gdbarch_float_format(), set_gdbarch_frame_align(), set_gdbarch_in_solib_return_trampoline(), 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_num_pseudo_regs(), set_gdbarch_num_regs(), set_gdbarch_pc_regnum(), set_gdbarch_pseudo_register_read(), set_gdbarch_pseudo_register_write(), set_gdbarch_ptr_bit(), set_gdbarch_push_dummy_call(), set_gdbarch_register_name(), set_gdbarch_register_reggroup_p(), set_gdbarch_register_sim_regno(), set_gdbarch_register_type(), set_gdbarch_return_value(), set_gdbarch_short_bit(), set_gdbarch_skip_prologue(), set_gdbarch_skip_trampoline_code(), set_gdbarch_sp_regnum(), set_gdbarch_sw_breakpoint_from_kind(), and set_gdbarch_vbit_in_delta().

Referenced by _initialize_msp430_tdep().

◆ msp430_get_opcode_byte()

static int msp430_get_opcode_byte ( void * handle)
static

Definition at line 299 of file msp430-tdep.c.

References status, and target_read_memory().

Referenced by msp430_analyze_prologue().

◆ msp430_in_return_stub()

static int msp430_in_return_stub ( struct gdbarch * gdbarch,
CORE_ADDR pc,
const char * name )
static

Definition at line 798 of file msp430-tdep.c.

References msp430_epilog_name_prefix, and name.

Referenced by msp430_gdbarch_init(), and msp430_skip_trampoline_code().

◆ msp430_prev_register()

static struct value * msp430_prev_register ( frame_info_ptr this_frame,
void ** this_prologue_cache,
int regnum )
static

◆ msp430_pseudo_register_read()

static enum register_status msp430_pseudo_register_read ( struct gdbarch * gdbarch,
readable_regcache * regcache,
int regnum,
gdb_byte * buffer )
static

◆ msp430_pseudo_register_write()

static void msp430_pseudo_register_write ( struct gdbarch * gdbarch,
struct regcache * regcache,
int regnum,
const gdb_byte * buffer )
static

◆ msp430_push_dummy_call()

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

◆ msp430_register_name()

static const char * msp430_register_name ( struct gdbarch * gdbarch,
int regnr )
static

Definition at line 188 of file msp430-tdep.c.

References gdb_static_assert(), MSP430_NUM_PSEUDO_REGS, and MSP430_NUM_REGS.

Referenced by msp430_gdbarch_init().

◆ msp430_register_reggroup_p()

static int msp430_register_reggroup_p ( struct gdbarch * gdbarch,
int regnum,
const struct reggroup * group )
static

◆ msp430_register_sim_regno()

static int msp430_register_sim_regno ( struct gdbarch * gdbarch,
int regnum )
static

Definition at line 271 of file msp430-tdep.c.

References MSP430_NUM_REGS, and regnum.

Referenced by msp430_gdbarch_init().

◆ msp430_register_type()

static struct type * msp430_register_type ( struct gdbarch * gdbarch,
int reg_nr )
static

◆ msp430_return_value()

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

◆ msp430_skip_prologue()

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

◆ msp430_skip_trampoline_code()

static CORE_ADDR msp430_skip_trampoline_code ( frame_info_ptr frame,
CORE_ADDR pc )
static

◆ msp430_this_id()

static void msp430_this_id ( frame_info_ptr this_frame,
void ** this_prologue_cache,
struct frame_id * this_id )
static

Definition at line 500 of file msp430-tdep.c.

References frame_id_build(), get_frame_func(), and msp430_frame_base().

◆ msp430x_register_type()

static struct type * msp430x_register_type ( struct gdbarch * gdbarch,
int reg_nr )
static

Variable Documentation

◆ msp430_break_insn

constexpr gdb_byte msp430_break_insn[] = { 0x43, 0x43 }
constexpr

Definition at line 281 of file msp430-tdep.c.

◆ msp430_epilog_name_prefix

const char msp430_epilog_name_prefix[] = "__mspabi_func_epilog_"
static

Definition at line 793 of file msp430-tdep.c.

Referenced by msp430_in_return_stub(), and msp430_skip_trampoline_code().

◆ msp430_unwind

const struct frame_unwind msp430_unwind
static
Initial value:
= {
"msp430 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 * msp430_prev_register(frame_info_ptr this_frame, void **this_prologue_cache, int regnum)
static void msp430_this_id(frame_info_ptr this_frame, void **this_prologue_cache, struct frame_id *this_id)

Definition at line 544 of file msp430-tdep.c.

Referenced by msp430_gdbarch_init().