GDB (xrefs)

Classes | Macros | Functions | Variables
/tmp/gdb-8.1/gdb/mn10300-tdep.c File Reference
`#include "defs.h"`
`#include "arch-utils.h"`
`#include "dis-asm.h"`
`#include "gdbtypes.h"`
`#include "regcache.h"`
`#include "gdbcore.h"`
`#include "value.h"`
`#include "frame.h"`
`#include "frame-unwind.h"`
`#include "frame-base.h"`
`#include "symtab.h"`
`#include "dwarf2-frame.h"`
`#include "osabi.h"`
`#include "infcall.h"`
`#include "prologue-value.h"`
`#include "target.h"`
`#include "mn10300-tdep.h"`

Go to the source code of this file.

## Classes
struct | mn10300_prologue

## Macros
#define | MN10300_MAX_NUM_REGS 64
#define | MN10300_MAX_REGISTER_SIZE 64

## Functions
static int | mn10300_type_align (struct type *type)
static int | mn10300_use_struct_convention (struct type *type)
static void | mn10300_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
static void | mn10300_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
static enum return_value_convention | mn10300_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static const char * | register_name (int reg, const char **regs, long sizeof_regs)
static const char * | mn10300_generic_register_name (struct gdbarch *gdbarch, int reg)
static const char * | am33_register_name (struct gdbarch *gdbarch, int reg)
static const char * | am33_2_register_name (struct gdbarch *gdbarch, int reg)
static struct type * | mn10300_register_type (struct gdbarch *gdbarch, int reg)
static CORE_ADDR | mn10300_read_pc (struct regcache *regcache)
static void | mn10300_write_pc (struct regcache *regcache, CORE_ADDR val)
typedef | BP_MANIPULATION (mn10300_break_insn)
static int | translate_rreg (int rreg)
static void | check_for_saved (void *result_untyped, pv_t addr, CORE_ADDR size, pv_t value)
static void | mn10300_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc, CORE_ADDR limit_pc, struct mn10300_prologue *result)
static CORE_ADDR | mn10300_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
static struct mn10300_prologue * | mn10300_analyze_frame_prologue (struct frame_info *this_frame, void **this_prologue_cache)
static CORE_ADDR | mn10300_frame_base (struct frame_info *this_frame, void **this_prologue_cache)
static struct frame_id | mn10300_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
static void | mn10300_frame_this_id (struct frame_info *this_frame, void **this_prologue_cache, struct frame_id *this_id)
static struct value * | mn10300_frame_prev_register (struct frame_info *this_frame, void **this_prologue_cache, int regnum)
static CORE_ADDR | mn10300_unwind_pc (struct gdbarch *gdbarch, struct frame_info *this_frame)
static CORE_ADDR | mn10300_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
static void | mn10300_frame_unwind_init (struct gdbarch *gdbarch)
static CORE_ADDR | mn10300_push_dummy_call (struct gdbarch *gdbarch, struct value *target_func, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
static int | mn10300_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2)
static struct gdbarch * | mn10300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
static void | mn10300_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
void | _initialize_mn10300_tdep (void)

## Variables
constexpr gdb_byte | mn10300_break_insn [] = {0xff}
static const struct frame_unwind | mn10300_frame_unwind

## Macro Definition Documentation

## ◆ MN10300_MAX_NUM_REGS

#define MN10300_MAX_NUM_REGS 64

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

Referenced by mn10300_analyze_prologue().

## ◆ MN10300_MAX_REGISTER_SIZE

#define MN10300_MAX_REGISTER_SIZE 64

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

Referenced by mn10300_extract_return_value(), and mn10300_push_dummy_call().

## Function Documentation

## ◆ _initialize_mn10300_tdep()

void _initialize_mn10300_tdep | ( | void |  | ) |

Definition at line 1468 of file mn10300-tdep.c.

References gdbarch_register(), mn10300_dump_tdep(), and mn10300_gdbarch_init().

## ◆ am33_2_register_name()

static const char* am33_2_register_name | ( | struct gdbarch * | gdbarch,
|  | int | reg
| ) |  |
| static

Definition at line 288 of file mn10300-tdep.c.

References register_name().

Referenced by mn10300_gdbarch_init().

## ◆ am33_register_name()

static const char* am33_register_name | ( | struct gdbarch * | gdbarch,
|  | int | reg
| ) |  |
| static

Definition at line 276 of file mn10300-tdep.c.

References register_name().

Referenced by mn10300_gdbarch_init().

## ◆ BP_MANIPULATION()

typedef BP_MANIPULATION | ( | mn10300_break_insn |  | ) |

Definition at line 332 of file mn10300-tdep.c.

References E_SP_REGNUM, pv_add_constant(), regnum, and pv_area::store().

## ◆ check_for_saved()

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

Definition at line 365 of file mn10300-tdep.c.

References E_SP_REGNUM, mn10300_prologue::gdbarch, prologue_value::k, pv_is_register(), pvk_register, value::reg, mn10300_prologue::reg_offset, register_size(), and size.

Referenced by mn10300_analyze_prologue().

## ◆ mn10300_analyze_frame_prologue()

static struct mn10300_prologue* mn10300_analyze_frame_prologue | ( | struct frame_info * | this_frame,
|  | void ** | this_prologue_cache
| ) |  |
| static

Definition at line 1064 of file mn10300-tdep.c.

References FRAME_OBSTACK_ZALLOC, get_frame_arch(), get_frame_func(), get_frame_pc(), and mn10300_analyze_prologue().

Referenced by mn10300_frame_base(), and mn10300_frame_prev_register().

## ◆ mn10300_analyze_prologue()

static void mn10300_analyze_prologue | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | start_pc,
|  | CORE_ADDR | limit_pc,
|  | struct mn10300_prologue * | result
| ) |  |
| static

Definition at line 381 of file mn10300-tdep.c.

References AM33_MODE, check_for_saved(), E_A0_REGNUM, E_A1_REGNUM, E_A2_REGNUM, E_A3_REGNUM, E_D0_REGNUM, E_D1_REGNUM, E_D2_REGNUM, E_D3_REGNUM, E_E0_REGNUM, E_E1_REGNUM, E_E2_REGNUM, E_E3_REGNUM, E_E4_REGNUM, E_E5_REGNUM, E_E6_REGNUM, E_E7_REGNUM, E_FS0_REGNUM, E_LAR_REGNUM, E_LIR_REGNUM, E_MCRH_REGNUM, E_MCRL_REGNUM, E_MCVF_REGNUM, E_MDR_REGNUM, E_MDRQ_REGNUM, E_PC_REGNUM, E_SP_REGNUM, extract_signed_integer(), mn10300_prologue::frame_ptr_offset, mn10300_prologue::frame_size, mn10300_prologue::gdbarch, gdbarch_addr_bit(), gdbarch_byte_order(), mn10300_prologue::has_frame_ptr, prologue_value::k, memset(), MN10300_MAX_NUM_REGS, movm_a2_bit, movm_a3_bit, movm_d2_bit, movm_d3_bit, movm_exother_bit, movm_exreg0_bit, movm_exreg1_bit, movm_other_bit, pv_add(), pv_add_constant(), pv_constant(), pv_is_register(), pv_register(), mn10300_prologue::reg_offset, pv_area::scan(), status, pv_area::store(), target_read_memory(), and translate_rreg().

Referenced by mn10300_analyze_frame_prologue(), and mn10300_skip_prologue().

## ◆ mn10300_dummy_id()

static struct frame_id mn10300_dummy_id | ( | struct gdbarch * | gdbarch,
|  | struct frame_info * | this_frame
| ) |  |
| static

Definition at line 1118 of file mn10300-tdep.c.

References E_PC_REGNUM, E_SP_REGNUM, frame_id_build(), and get_frame_register_unsigned().

Referenced by mn10300_frame_unwind_init().

## ◆ mn10300_dump_tdep()

static void mn10300_dump_tdep | ( | struct gdbarch * | gdbarch,
|  | struct ui_file * | file
| ) |  |
| static

Definition at line 1460 of file mn10300-tdep.c.

References gdbarch_tdep::am33_mode, fprintf_unfiltered(), and gdbarch_tdep().

Referenced by _initialize_mn10300_tdep().

## ◆ mn10300_dwarf2_reg_to_regnum()

static int mn10300_dwarf2_reg_to_regnum | ( | struct gdbarch * | gdbarch,
|  | int | dwarf2
| ) |  |
| static

Definition at line 1343 of file mn10300-tdep.c.

References E_A0_REGNUM, E_A1_REGNUM, E_A2_REGNUM, E_A3_REGNUM, E_D0_REGNUM, E_D1_REGNUM, E_D2_REGNUM, E_D3_REGNUM, E_E0_REGNUM, E_E1_REGNUM, E_E2_REGNUM, E_E3_REGNUM, E_E4_REGNUM, E_E5_REGNUM, E_E6_REGNUM, E_E7_REGNUM, E_FS0_REGNUM, E_MDR_REGNUM, E_PC_REGNUM, E_PSW_REGNUM, and E_SP_REGNUM.

Referenced by mn10300_gdbarch_init().

## ◆ mn10300_extract_return_value()

static void mn10300_extract_return_value | ( | struct gdbarch * | gdbarch,
|  | struct type * | type,
|  | struct regcache * | regcache,
|  | void * | valbuf
| ) |  |
| static

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

References _, gdb_assert, internal_error(), MN10300_MAX_REGISTER_SIZE, regcache_raw_read(), register_size(), TYPE_CODE, TYPE_CODE_PTR, and TYPE_LENGTH.

Referenced by mn10300_return_value().

## ◆ mn10300_frame_base()

static CORE_ADDR mn10300_frame_base | ( | struct frame_info * | this_frame,
|  | void ** | this_prologue_cache
| ) |  |
| static

Definition at line 1093 of file mn10300-tdep.c.

References E_A3_REGNUM, E_SP_REGNUM, mn10300_prologue::frame_ptr_offset, mn10300_prologue::frame_size, get_frame_register_unsigned(), mn10300_prologue::has_frame_ptr, and mn10300_analyze_frame_prologue().

Referenced by mn10300_frame_prev_register(), and mn10300_frame_this_id().

## ◆ mn10300_frame_prev_register()

static struct value* mn10300_frame_prev_register | ( | struct frame_info * | this_frame,
|  | void ** | this_prologue_cache,
|  | int | regnum
| ) |  |
| static

Definition at line 1137 of file mn10300-tdep.c.

References E_SP_REGNUM, frame_unwind_got_constant(), frame_unwind_got_memory(), frame_unwind_got_register(), mn10300_analyze_frame_prologue(), mn10300_frame_base(), mn10300_prologue::reg_offset, and regnum.

## ◆ mn10300_frame_this_id()

static void mn10300_frame_this_id | ( | struct frame_info * | this_frame,
|  | void ** | this_prologue_cache,
|  | struct frame_id * | this_id
| ) |  |
| static

Definition at line 1126 of file mn10300-tdep.c.

References frame_id_build(), get_frame_func(), mn10300_frame_base(), and frame_info::this_id.

## ◆ mn10300_frame_unwind_init()

static void mn10300_frame_unwind_init | ( | struct gdbarch * | gdbarch | ) |
| static

Definition at line 1186 of file mn10300-tdep.c.

References dwarf2_append_unwinders(), frame_unwind_append_unwinder(), mn10300_dummy_id(), mn10300_frame_unwind, mn10300_unwind_pc(), mn10300_unwind_sp(), set_gdbarch_dummy_id(), set_gdbarch_unwind_pc(), and set_gdbarch_unwind_sp().

Referenced by mn10300_gdbarch_init().

## ◆ mn10300_gdbarch_init()

static struct gdbarch* mn10300_gdbarch_init | ( | struct gdbarch_info | info,
|  | struct gdbarch_list * | arches
| ) |  |
| static

Definition at line 1380 of file mn10300-tdep.c.

References _, am33_2_register_name(), gdbarch_tdep::am33_mode, am33_register_name(), gdbarch_info::bfd_arch_info, core_addr_lessthan(), E_PC_REGNUM, E_SP_REGNUM, gdbarch_list::gdbarch, gdbarch_alloc(), gdbarch_init_osabi(), gdbarch_list_lookup_by_info(), internal_error(), mn10300_dwarf2_reg_to_regnum(), mn10300_frame_unwind_init(), mn10300_generic_register_name(), mn10300_push_dummy_call(), mn10300_read_pc(), mn10300_register_type(), mn10300_return_value(), mn10300_skip_prologue(), mn10300_write_pc(), gdbarch_tdep::num_regs, set_gdbarch_breakpoint_kind_from_pc(), set_gdbarch_char_signed(), set_gdbarch_dwarf2_reg_to_regnum(), set_gdbarch_fp0_regnum(), set_gdbarch_inner_than(), set_gdbarch_num_regs(), set_gdbarch_pc_regnum(), set_gdbarch_push_dummy_call(), set_gdbarch_read_pc(), set_gdbarch_register_name(), set_gdbarch_register_type(), set_gdbarch_return_value(), set_gdbarch_skip_prologue(), set_gdbarch_sp_regnum(), set_gdbarch_sw_breakpoint_from_kind(), set_gdbarch_write_pc(), and XCNEW.

Referenced by _initialize_mn10300_tdep().

## ◆ mn10300_generic_register_name()

static const char* mn10300_generic_register_name | ( | struct gdbarch * | gdbarch,
|  | int | reg
| ) |  |
| static

Definition at line 263 of file mn10300-tdep.c.

References register_name().

Referenced by mn10300_gdbarch_init().

## ◆ mn10300_push_dummy_call()

static CORE_ADDR mn10300_push_dummy_call | ( | struct gdbarch * | gdbarch,
|  | struct value * | target_func,
|  | struct regcache * | regcache,
|  | CORE_ADDR | bp_addr,
|  | int | nargs,
|  | struct value ** | args,
|  | CORE_ADDR | sp,
|  | int | struct_return,
|  | CORE_ADDR | struct_addr
| ) |  |
| static

Definition at line 1203 of file mn10300-tdep.c.

References create_new_frame(), E_D0_REGNUM, E_MDR_REGNUM, E_PC_REGNUM, E_SP_REGNUM, extract_unsigned_integer(), find_function_addr(), gdb_assert, gdbarch_byte_order(), MN10300_MAX_REGISTER_SIZE, mn10300_unwind_sp(), regcache_cooked_write_unsigned(), register_size(), store_unsigned_integer(), TYPE_CODE, TYPE_CODE_STRUCT, TYPE_LENGTH, value_address(), value_contents(), value_type(), write_memory(), and write_memory_unsigned_integer().

Referenced by mn10300_gdbarch_init().

## ◆ mn10300_read_pc()

static CORE_ADDR mn10300_read_pc | ( | struct regcache * | regcache | ) |
| static

Definition at line 311 of file mn10300-tdep.c.

References E_PC_REGNUM, and regcache_cooked_read_unsigned().

Referenced by mn10300_gdbarch_init().

## ◆ mn10300_register_type()

static struct type* mn10300_register_type | ( | struct gdbarch * | gdbarch,
|  | int | reg
| ) |  |
| static

Definition at line 305 of file mn10300-tdep.c.

References builtin_type::builtin_int, and builtin_type().

Referenced by mn10300_gdbarch_init().

## ◆ mn10300_return_value()

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

Definition at line 238 of file mn10300-tdep.c.

References mn10300_extract_return_value(), mn10300_store_return_value(), mn10300_use_struct_convention(), RETURN_VALUE_REGISTER_CONVENTION, and RETURN_VALUE_STRUCT_CONVENTION.

Referenced by mn10300_gdbarch_init().

## ◆ mn10300_skip_prologue()

static CORE_ADDR mn10300_skip_prologue | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | pc
| ) |  |
| static

Definition at line 1046 of file mn10300-tdep.c.

References find_pc_partial_function(), mn10300_analyze_prologue(), name, and mn10300_prologue::prologue_end.

Referenced by mn10300_gdbarch_init().

## ◆ mn10300_store_return_value()

static void mn10300_store_return_value | ( | struct gdbarch * | gdbarch,
|  | struct type * | type,
|  | struct regcache * | regcache,
|  | const gdb_byte * | valbuf
| ) |  |
| static

Definition at line 171 of file mn10300-tdep.c.

References _, gdb_assert, internal_error(), regcache_raw_write(), regcache_raw_write_part(), register_size(), TYPE_CODE, TYPE_CODE_PTR, and TYPE_LENGTH.

Referenced by mn10300_return_value().

## ◆ mn10300_type_align()

static int mn10300_type_align | ( | struct type * | type | ) |
| static

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

References _, check_typedef(), internal_error(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_COMPLEX, TYPE_CODE_ENUM, TYPE_CODE_FLT, TYPE_CODE_INT, TYPE_CODE_PTR, TYPE_CODE_RANGE, TYPE_CODE_REF, TYPE_CODE_RVALUE_REF, TYPE_CODE_SET, TYPE_CODE_STRUCT, TYPE_CODE_TYPEDEF, TYPE_CODE_UNION, TYPE_FIELD_TYPE, TYPE_LENGTH, and TYPE_NFIELDS.

Referenced by mn10300_use_struct_convention().

## ◆ mn10300_unwind_pc()

static CORE_ADDR mn10300_unwind_pc | ( | struct gdbarch * | gdbarch,
|  | struct frame_info * | this_frame
| ) |  |
| static

Definition at line 1168 of file mn10300-tdep.c.

References E_PC_REGNUM, and frame_unwind_register_unsigned().

Referenced by mn10300_frame_unwind_init().

## ◆ mn10300_unwind_sp()

static CORE_ADDR mn10300_unwind_sp | ( | struct gdbarch * | gdbarch,
|  | struct frame_info * | this_frame
| ) |  |
| static

Definition at line 1177 of file mn10300-tdep.c.

References E_SP_REGNUM, and frame_unwind_register_unsigned().

Referenced by mn10300_frame_unwind_init(), and mn10300_push_dummy_call().

## ◆ mn10300_use_struct_convention()

static int mn10300_use_struct_convention | ( | struct type * | type | ) |
| static

Definition at line 133 of file mn10300-tdep.c.

References check_typedef(), mn10300_type_align(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_STRUCT, TYPE_CODE_TYPEDEF, TYPE_CODE_UNION, TYPE_FIELD_TYPE, TYPE_LENGTH, and TYPE_NFIELDS.

Referenced by mn10300_return_value().

## ◆ mn10300_write_pc()

static void mn10300_write_pc | ( | struct regcache * | regcache,
|  | CORE_ADDR | val
| ) |  |
| static

Definition at line 319 of file mn10300-tdep.c.

References E_PC_REGNUM, and regcache_cooked_write_unsigned().

Referenced by mn10300_gdbarch_init().

## ◆ register_name()

static const char* register_name | ( | int | reg,
|  | const char ** | regs,
|  | long | sizeof_regs
| ) |  |
| static

Definition at line 254 of file mn10300-tdep.c.

Referenced by am33_2_register_name(), am33_register_name(), mn10300_generic_register_name(), and set_gdbarch_register_name().

## ◆ translate_rreg()

static int translate_rreg | ( | int | rreg | ) |
| static

Definition at line 347 of file mn10300-tdep.c.

References E_A0_REGNUM, E_D0_REGNUM, and E_E0_REGNUM.

Referenced by mn10300_analyze_prologue().

## Variable Documentation

## ◆ mn10300_break_insn

constexpr gdb_byte mn10300_break_insn[] = {0xff}

Definition at line 330 of file mn10300-tdep.c.

## ◆ mn10300_frame_unwind

const struct frame_unwind mn10300_frame_unwind
| static

Initial value:
= {
NORMAL_FRAME,
default_frame_unwind_stop_reason,
mn10300_frame_this_id,
mn10300_frame_prev_register,
NULL,
default_frame_sniffer
}
NORMAL_FRAME
Definition: frame.h:244
mn10300_frame_this_id
static void mn10300_frame_this_id(struct frame_info *this_frame, void **this_prologue_cache, struct frame_id *this_id)
Definition: mn10300-tdep.c:1126
default_frame_sniffer
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
Definition: frame-unwind.c:174
mn10300_frame_prev_register
static struct value * mn10300_frame_prev_register(struct frame_info *this_frame, void **this_prologue_cache, int regnum)
Definition: mn10300-tdep.c:1137
default_frame_unwind_stop_reason
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 1158 of file mn10300-tdep.c.

Referenced by mn10300_frame_unwind_init().