GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
sh-tdep.c File Reference
#include "defs.h"
#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
#include "dwarf2/frame.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "gdbcmd.h"
#include "gdbcore.h"
#include "value.h"
#include "dis-asm.h"
#include "inferior.h"
#include "arch-utils.h"
#include "regcache.h"
#include "target-float.h"
#include "osabi.h"
#include "reggroups.h"
#include "regset.h"
#include "objfiles.h"
#include "sh-tdep.h"
#include "elf-bfd.h"
#include "solib-svr4.h"
#include "elf/sh.h"
#include "dwarf2.h"
#include "sim/sim-sh.h"
#include <algorithm>

Go to the source code of this file.

Classes

struct  sh_frame_cache
 

Macros

#define SH_NUM_REGS   67
 
#define GET_SOURCE_REG(x)   (((x) >> 4) & 0xf)
 
#define GET_TARGET_REG(x)   (((x) >> 8) & 0xf)
 
#define IS_JSR(x)   (((x) & 0xf0ff) == 0x400b)
 
#define IS_STS(x)   ((x) == 0x4f22)
 
#define IS_MACL_STS(x)   ((x) == 0x4f12)
 
#define IS_PUSH(x)   (((x) & 0xff0f) == 0x2f06)
 
#define IS_MOV_SP_FP(x)   ((x) == 0x6ef3)
 
#define IS_ADD_IMM_SP(x)   (((x) & 0xff00) == 0x7f00)
 
#define IS_MOV_R3(x)   (((x) & 0xff00) == 0x1a00)
 
#define IS_SHLL_R3(x)   ((x) == 0x4300)
 
#define IS_ADD_R3SP(x)   ((x) == 0x3f3c)
 
#define IS_FPUSH(x)   (((x) & 0xff0f) == 0xff0b)
 
#define IS_MOV_ARG_TO_REG(x)
 
#define IS_MOV_ARG_TO_IND_R14(x)
 
#define IS_MOV_ARG_TO_IND_R14_WITH_DISP(x)
 
#define IS_MOVW_PCREL_TO_REG(x)   (((x) & 0xf000) == 0x9000)
 
#define IS_MOVL_PCREL_TO_REG(x)   (((x) & 0xf000) == 0xd000)
 
#define IS_MOVI20(x)   (((x) & 0xf00f) == 0x0000)
 
#define IS_SUB_REG_FROM_SP(x)   (((x) & 0xff0f) == 0x3f08)
 
#define FPSCR_SZ   (1 << 20)
 
#define IS_RESTORE_FP(x)   ((x) == 0x6ef6)
 
#define IS_RTS(x)   ((x) == 0x000b)
 
#define IS_LDS(x)   ((x) == 0x4f26)
 
#define IS_MACL_LDS(x)   ((x) == 0x4f16)
 
#define IS_MOV_FP_SP(x)   ((x) == 0x6fe3)
 
#define IS_ADD_REG_TO_FP(x)   (((x) & 0xff0f) == 0x3e0c)
 
#define IS_ADD_IMM_FP(x)   (((x) & 0xff00) == 0x7e00)
 

Functions

static int sh_is_renesas_calling_convention (struct type *func_type)
 
static const char * sh_sh_register_name (struct gdbarch *gdbarch, int reg_nr)
 
static const char * sh_sh3_register_name (struct gdbarch *gdbarch, int reg_nr)
 
static const char * sh_sh3e_register_name (struct gdbarch *gdbarch, int reg_nr)
 
static const char * sh_sh2e_register_name (struct gdbarch *gdbarch, int reg_nr)
 
static const char * sh_sh2a_register_name (struct gdbarch *gdbarch, int reg_nr)
 
static const char * sh_sh2a_nofpu_register_name (struct gdbarch *gdbarch, int reg_nr)
 
static const char * sh_sh_dsp_register_name (struct gdbarch *gdbarch, int reg_nr)
 
static const char * sh_sh3_dsp_register_name (struct gdbarch *gdbarch, int reg_nr)
 
static const char * sh_sh4_register_name (struct gdbarch *gdbarch, int reg_nr)
 
static const char * sh_sh4_nofpu_register_name (struct gdbarch *gdbarch, int reg_nr)
 
static const char * sh_sh4al_dsp_register_name (struct gdbarch *gdbarch, int reg_nr)
 
static int sh_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
 
static const gdb_byte * sh_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
 
static CORE_ADDR sh_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR limit_pc, struct sh_frame_cache *cache, ULONGEST fpscr)
 
static CORE_ADDR sh_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
 
static int sh_use_struct_convention (int renesas_abi, struct type *type)
 
static int sh_use_struct_convention_nofpu (int renesas_abi, struct type *type)
 
static CORE_ADDR sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
 
static const gdb_byte * sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, int len)
 
static CORE_ADDR sh_stack_allocsize (int nargs, struct value **args)
 
static void sh_init_flt_argreg (void)
 
static int sh_next_flt_argreg (struct gdbarch *gdbarch, int len, struct type *func_type)
 
static int sh_treat_as_flt_p (struct type *type)
 
static CORE_ADDR sh_push_dummy_call_fpu (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 CORE_ADDR sh_push_dummy_call_nofpu (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 void sh_extract_return_value_nofpu (struct type *type, struct regcache *regcache, gdb_byte *valbuf)
 
static void sh_extract_return_value_fpu (struct type *type, struct regcache *regcache, gdb_byte *valbuf)
 
static void sh_store_return_value_nofpu (struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
 
static void sh_store_return_value_fpu (struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
 
static enum return_value_convention sh_return_value_nofpu (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
 
static enum return_value_convention sh_return_value_fpu (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
 
static struct typesh_sh2a_register_type (struct gdbarch *gdbarch, int reg_nr)
 
static struct typesh_sh3e_register_type (struct gdbarch *gdbarch, int reg_nr)
 
static struct typesh_sh4_build_float_register_type (struct gdbarch *gdbarch, int high)
 
static struct typesh_sh4_register_type (struct gdbarch *gdbarch, int reg_nr)
 
static struct typesh_default_register_type (struct gdbarch *gdbarch, int reg_nr)
 
static int sh_register_reggroup_p (struct gdbarch *gdbarch, int regnum, const struct reggroup *reggroup)
 
static struct typesh_littlebyte_bigword_type (struct gdbarch *gdbarch)
 
static void sh_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, gdb_byte *from, gdb_byte *to)
 
static void sh_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, const gdb_byte *from, gdb_byte *to)
 
static int fv_reg_base_num (struct gdbarch *gdbarch, int fv_regnum)
 
static int dr_reg_base_num (struct gdbarch *gdbarch, int dr_regnum)
 
static enum register_status pseudo_register_read_portions (struct gdbarch *gdbarch, readable_regcache *regcache, int portions, int base_regnum, gdb_byte *buffer)
 
static enum register_status sh_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, int reg_nr, gdb_byte *buffer)
 
static void sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, const gdb_byte *buffer)
 
static int sh_dsp_register_sim_regno (struct gdbarch *gdbarch, int nr)
 
static int sh_sh2a_register_sim_regno (struct gdbarch *gdbarch, int nr)
 
static void sh_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, frame_info_ptr this_frame)
 
static struct sh_frame_cachesh_alloc_frame_cache (void)
 
static struct sh_frame_cache * sh_frame_cache (frame_info_ptr this_frame, void **this_cache)
 
static struct valuesh_frame_prev_register (frame_info_ptr this_frame, void **this_cache, int regnum)
 
static void sh_frame_this_id (frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
 
static CORE_ADDR sh_frame_base_address (frame_info_ptr this_frame, void **this_cache)
 
static struct sh_frame_cachesh_make_stub_cache (frame_info_ptr this_frame)
 
static void sh_stub_this_id (frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
 
static int sh_stub_unwind_sniffer (const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
 
static int sh_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 
void sh_corefile_supply_regset (const struct regset *regset, struct regcache *regcache, int regnum, const void *regs, size_t len)
 
void sh_corefile_collect_regset (const struct regset *regset, const struct regcache *regcache, int regnum, void *regs, size_t len)
 
static void sh_iterate_over_regset_sections (struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
 
static int sh_return_in_first_hidden_param_p (struct gdbarch *gdbarch, struct type *type)
 
static struct gdbarchsh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
void _initialize_sh_tdep ()
 

Variables

static struct cmd_list_elementsetshcmdlist = NULL
 
static struct cmd_list_elementshowshcmdlist = NULL
 
static const char sh_cc_gcc [] = "gcc"
 
static const char sh_cc_renesas [] = "renesas"
 
static const char *const sh_cc_enum []
 
static const char * sh_active_calling_convention = sh_cc_gcc
 
static int flt_argreg_array [FLOAT_ARGLAST_REGNUM - FLOAT_ARG0_REGNUM+1]
 
static const struct frame_unwind sh_frame_unwind
 
static const struct frame_base sh_frame_base
 
static const struct frame_unwind sh_stub_unwind
 
const struct regset sh_corefile_gregset
 
static const struct regset sh_corefile_fpregset
 

Macro Definition Documentation

◆ FPSCR_SZ

#define FPSCR_SZ   (1 << 20)

Definition at line 490 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ GET_SOURCE_REG

#define GET_SOURCE_REG ( x)    (((x) >> 4) & 0xf)

Definition at line 424 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ GET_TARGET_REG

#define GET_TARGET_REG ( x)    (((x) >> 8) & 0xf)

Definition at line 425 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_ADD_IMM_FP

#define IS_ADD_IMM_FP ( x)    (((x) & 0xff00) == 0x7e00)

Definition at line 499 of file sh-tdep.c.

Referenced by sh_stack_frame_destroyed_p().

◆ IS_ADD_IMM_SP

#define IS_ADD_IMM_SP ( x)    (((x) & 0xff00) == 0x7f00)

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

Referenced by sh_analyze_prologue().

◆ IS_ADD_R3SP

#define IS_ADD_R3SP ( x)    ((x) == 0x3f3c)

Definition at line 455 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_ADD_REG_TO_FP

#define IS_ADD_REG_TO_FP ( x)    (((x) & 0xff0f) == 0x3e0c)

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

Referenced by sh_stack_frame_destroyed_p().

◆ IS_FPUSH

#define IS_FPUSH ( x)    (((x) & 0xff0f) == 0xff0b)

Definition at line 463 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_JSR

#define IS_JSR ( x)    (((x) & 0xf0ff) == 0x400b)

Definition at line 428 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_LDS

#define IS_LDS ( x)    ((x) == 0x4f26)

Definition at line 495 of file sh-tdep.c.

Referenced by sh_stack_frame_destroyed_p().

◆ IS_MACL_LDS

#define IS_MACL_LDS ( x)    ((x) == 0x4f16)

Definition at line 496 of file sh-tdep.c.

Referenced by sh_stack_frame_destroyed_p().

◆ IS_MACL_STS

#define IS_MACL_STS ( x)    ((x) == 0x4f12)

Definition at line 436 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_MOV_ARG_TO_IND_R14

#define IS_MOV_ARG_TO_IND_R14 ( x)
Value:
(((x) & 0xff0f) == 0x2e02 && \
((x) & 0x00f0) >= 0x0040 && \
((x) & 0x00f0) <= 0x0070)

Definition at line 471 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_MOV_ARG_TO_IND_R14_WITH_DISP

#define IS_MOV_ARG_TO_IND_R14_WITH_DISP ( x)
Value:
(((x) & 0xff00) == 0x1e00 && \
((x) & 0x00f0) >= 0x0040 && \
((x) & 0x00f0) <= 0x0070)

Definition at line 476 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_MOV_ARG_TO_REG

#define IS_MOV_ARG_TO_REG ( x)
Value:
(((x) & 0xf00f) == 0x6003 && \
((x) & 0x00f0) >= 0x0040 && \
((x) & 0x00f0) <= 0x0070)

Definition at line 466 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_MOV_FP_SP

#define IS_MOV_FP_SP ( x)    ((x) == 0x6fe3)

Definition at line 497 of file sh-tdep.c.

Referenced by sh_stack_frame_destroyed_p().

◆ IS_MOV_R3

#define IS_MOV_R3 ( x)    (((x) & 0xff00) == 0x1a00)

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

Referenced by sh_analyze_prologue().

◆ IS_MOV_SP_FP

#define IS_MOV_SP_FP ( x)    ((x) == 0x6ef3)

Definition at line 444 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_MOVI20

#define IS_MOVI20 ( x)    (((x) & 0xf00f) == 0x0000)

Definition at line 486 of file sh-tdep.c.

Referenced by sh_analyze_prologue(), and sh_stack_frame_destroyed_p().

◆ IS_MOVL_PCREL_TO_REG

#define IS_MOVL_PCREL_TO_REG ( x)    (((x) & 0xf000) == 0xd000)

Definition at line 484 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_MOVW_PCREL_TO_REG

#define IS_MOVW_PCREL_TO_REG ( x)    (((x) & 0xf000) == 0x9000)

Definition at line 482 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_PUSH

#define IS_PUSH ( x)    (((x) & 0xff0f) == 0x2f06)

Definition at line 440 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_RESTORE_FP

#define IS_RESTORE_FP ( x)    ((x) == 0x6ef6)

Definition at line 493 of file sh-tdep.c.

Referenced by sh_stack_frame_destroyed_p().

◆ IS_RTS

#define IS_RTS ( x)    ((x) == 0x000b)

Definition at line 494 of file sh-tdep.c.

Referenced by sh_stack_frame_destroyed_p().

◆ IS_SHLL_R3

#define IS_SHLL_R3 ( x)    ((x) == 0x4300)

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

Referenced by sh_analyze_prologue().

◆ IS_STS

#define IS_STS ( x)    ((x) == 0x4f22)

Definition at line 432 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ IS_SUB_REG_FROM_SP

#define IS_SUB_REG_FROM_SP ( x)    (((x) & 0xff0f) == 0x3f08)

Definition at line 488 of file sh-tdep.c.

Referenced by sh_analyze_prologue().

◆ SH_NUM_REGS

#define SH_NUM_REGS   67

Definition at line 69 of file sh-tdep.c.

Referenced by sh_alloc_frame_cache(), sh_frame_cache(), and sh_gdbarch_init().

Function Documentation

◆ _initialize_sh_tdep()

void _initialize_sh_tdep ( )

◆ dr_reg_base_num()

static int dr_reg_base_num ( struct gdbarch * gdbarch,
int dr_regnum )
static

Definition at line 1579 of file sh-tdep.c.

References DR0_REGNUM, fp_regnum, and gdbarch_fp0_regnum().

Referenced by sh_pseudo_register_read(), and sh_pseudo_register_write().

◆ fv_reg_base_num()

static int fv_reg_base_num ( struct gdbarch * gdbarch,
int fv_regnum )
static

Definition at line 1568 of file sh-tdep.c.

References fp_regnum, FV0_REGNUM, and gdbarch_fp0_regnum().

Referenced by sh_pseudo_register_read(), and sh_pseudo_register_write().

◆ pseudo_register_read_portions()

static enum register_status pseudo_register_read_portions ( struct gdbarch * gdbarch,
readable_regcache * regcache,
int portions,
int base_regnum,
gdb_byte * buffer )
static

Definition at line 1592 of file sh-tdep.c.

References readable_regcache::raw_read(), register_size(), and status.

Referenced by sh_pseudo_register_read().

◆ sh_alloc_frame_cache()

static struct sh_frame_cache * sh_alloc_frame_cache ( void )
static

◆ sh_analyze_prologue()

static CORE_ADDR sh_analyze_prologue ( struct gdbarch * gdbarch,
CORE_ADDR pc,
CORE_ADDR limit_pc,
struct sh_frame_cache * cache,
ULONGEST fpscr )
static

◆ sh_breakpoint_kind_from_pc()

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

Definition at line 382 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_corefile_collect_regset()

void sh_corefile_collect_regset ( const struct regset * regset,
const struct regcache * regcache,
int regnum,
void * regs,
size_t len )

◆ sh_corefile_supply_regset()

void sh_corefile_supply_regset ( const struct regset * regset,
struct regcache * regcache,
int regnum,
const void * regs,
size_t len )

◆ sh_default_register_type()

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

Definition at line 1442 of file sh-tdep.c.

References builtin_type::builtin_int, and builtin_type().

Referenced by sh_gdbarch_init().

◆ sh_dsp_register_sim_regno()

static int sh_dsp_register_sim_regno ( struct gdbarch * gdbarch,
int nr )
static

◆ sh_dwarf2_frame_init_reg()

static void sh_dwarf2_frame_init_reg ( struct gdbarch * gdbarch,
int regnum,
struct dwarf2_frame_state_reg * reg,
frame_info_ptr this_frame )
static

◆ sh_extract_return_value_fpu()

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

◆ sh_extract_return_value_nofpu()

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

◆ sh_frame_align()

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

Definition at line 818 of file sh-tdep.c.

Referenced by sh_gdbarch_init(), sh_push_dummy_call_fpu(), and sh_push_dummy_call_nofpu().

◆ sh_frame_base_address()

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

Definition at line 1943 of file sh-tdep.c.

References sh_frame_cache::base, and sh_frame_cache().

◆ sh_frame_cache()

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

◆ sh_frame_prev_register()

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

◆ sh_frame_this_id()

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

◆ sh_gdbarch_init()

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

Definition at line 2199 of file sh-tdep.c.

References arches, core_addr_lessthan(), dwarf2_append_unwinders(), dwarf2_frame_set_init_reg(), floatformats_ieee_single, frame_base_set_default(), frame_unwind_append_unwinder(), gdbarch_alloc(), gdbarch_init_osabi(), gdbarch_list_lookup_by_info(), gdbarch::info(), legacy_register_sim_regno(), set_gdbarch_believe_pcc_promotion(), set_gdbarch_breakpoint_kind_from_pc(), set_gdbarch_double_bit(), set_gdbarch_double_format(), set_gdbarch_float_bit(), set_gdbarch_fp0_regnum(), set_gdbarch_frame_align(), set_gdbarch_inner_than(), set_gdbarch_int_bit(), set_gdbarch_iterate_over_regset_sections(), set_gdbarch_long_bit(), set_gdbarch_long_double_bit(), 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_in_first_hidden_param_p(), set_gdbarch_return_value(), set_gdbarch_short_bit(), set_gdbarch_skip_prologue(), set_gdbarch_sp_regnum(), set_gdbarch_stack_frame_destroyed_p(), set_gdbarch_sw_breakpoint_from_kind(), set_gdbarch_wchar_bit(), set_gdbarch_wchar_signed(), sh_breakpoint_kind_from_pc(), sh_default_register_type(), sh_dsp_register_sim_regno(), sh_dwarf2_frame_init_reg(), sh_frame_align(), sh_frame_base, sh_frame_unwind, sh_iterate_over_regset_sections(), SH_NUM_REGS, sh_pseudo_register_read(), sh_pseudo_register_write(), sh_push_dummy_call_fpu(), sh_push_dummy_call_nofpu(), sh_register_reggroup_p(), sh_return_in_first_hidden_param_p(), sh_return_value_fpu(), sh_return_value_nofpu(), sh_sh2a_nofpu_register_name(), sh_sh2a_register_name(), sh_sh2a_register_sim_regno(), sh_sh2a_register_type(), sh_sh2e_register_name(), sh_sh3_dsp_register_name(), sh_sh3_register_name(), sh_sh3e_register_name(), sh_sh3e_register_type(), sh_sh4_nofpu_register_name(), sh_sh4_register_name(), sh_sh4_register_type(), sh_sh4al_dsp_register_name(), sh_sh_dsp_register_name(), sh_sh_register_name(), sh_skip_prologue(), sh_stack_frame_destroyed_p(), sh_stub_unwind, and sh_sw_breakpoint_from_kind().

Referenced by _initialize_sh_tdep().

◆ sh_init_flt_argreg()

static void sh_init_flt_argreg ( void )
static

Definition at line 913 of file sh-tdep.c.

References flt_argreg_array.

Referenced by sh_push_dummy_call_fpu().

◆ sh_is_renesas_calling_convention()

static int sh_is_renesas_calling_convention ( struct type * func_type)
static

◆ sh_iterate_over_regset_sections()

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

◆ sh_justify_value_in_reg()

static const gdb_byte * sh_justify_value_in_reg ( struct gdbarch * gdbarch,
struct value * val,
int len )
static

Definition at line 877 of file sh-tdep.c.

References value::contents(), and gdbarch_byte_order().

Referenced by sh_push_dummy_call_fpu(), and sh_push_dummy_call_nofpu().

◆ sh_littlebyte_bigword_type()

static struct type * sh_littlebyte_bigword_type ( struct gdbarch * gdbarch)
static

◆ sh_make_stub_cache()

static struct sh_frame_cache * sh_make_stub_cache ( frame_info_ptr this_frame)
static

◆ sh_next_flt_argreg()

static int sh_next_flt_argreg ( struct gdbarch * gdbarch,
int len,
struct type * func_type )
static

◆ sh_pseudo_register_read()

static enum register_status sh_pseudo_register_read ( struct gdbarch * gdbarch,
readable_regcache * regcache,
int reg_nr,
gdb_byte * buffer )
static

◆ sh_pseudo_register_write()

static void sh_pseudo_register_write ( struct gdbarch * gdbarch,
struct regcache * regcache,
int reg_nr,
const gdb_byte * buffer )
static

◆ sh_push_dummy_call_fpu()

static CORE_ADDR sh_push_dummy_call_fpu ( 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

◆ sh_push_dummy_call_nofpu()

static CORE_ADDR sh_push_dummy_call_nofpu ( 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

◆ sh_register_convert_to_raw()

static void sh_register_convert_to_raw ( struct gdbarch * gdbarch,
struct type * type,
int regnum,
const gdb_byte * from,
gdb_byte * to )
static

◆ sh_register_convert_to_virtual()

static void sh_register_convert_to_virtual ( struct gdbarch * gdbarch,
int regnum,
struct type * type,
gdb_byte * from,
gdb_byte * to )
static

◆ sh_register_reggroup_p()

static int sh_register_reggroup_p ( struct gdbarch * gdbarch,
int regnum,
const struct reggroup * reggroup )
static

◆ sh_return_in_first_hidden_param_p()

static int sh_return_in_first_hidden_param_p ( struct gdbarch * gdbarch,
struct type * type )
static

Definition at line 2190 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_return_value_fpu()

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

◆ sh_return_value_nofpu()

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

◆ sh_sh2a_nofpu_register_name()

static const char * sh_sh2a_nofpu_register_name ( struct gdbarch * gdbarch,
int reg_nr )
static

Definition at line 217 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_sh2a_register_name()

static const char * sh_sh2a_register_name ( struct gdbarch * gdbarch,
int reg_nr )
static

Definition at line 179 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_sh2a_register_sim_regno()

static int sh_sh2a_register_sim_regno ( struct gdbarch * gdbarch,
int nr )
static

◆ sh_sh2a_register_type()

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

◆ sh_sh2e_register_name()

static const char * sh_sh2e_register_name ( struct gdbarch * gdbarch,
int reg_nr )
static

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

Referenced by sh_gdbarch_init().

◆ sh_sh3_dsp_register_name()

static const char * sh_sh3_dsp_register_name ( struct gdbarch * gdbarch,
int reg_nr )
static

Definition at line 272 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_sh3_register_name()

static const char * sh_sh3_register_name ( struct gdbarch * gdbarch,
int reg_nr )
static

Definition at line 124 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_sh3e_register_name()

static const char * sh_sh3e_register_name ( struct gdbarch * gdbarch,
int reg_nr )
static

Definition at line 144 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_sh3e_register_type()

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

◆ sh_sh4_build_float_register_type()

static struct type * sh_sh4_build_float_register_type ( struct gdbarch * gdbarch,
int high )
static

Definition at line 1421 of file sh-tdep.c.

References lookup_array_range_type().

Referenced by sh_sh4_register_type().

◆ sh_sh4_nofpu_register_name()

static const char * sh_sh4_nofpu_register_name ( struct gdbarch * gdbarch,
int reg_nr )
static

Definition at line 327 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_sh4_register_name()

static const char * sh_sh4_register_name ( struct gdbarch * gdbarch,
int reg_nr )
static

Definition at line 291 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_sh4_register_type()

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

◆ sh_sh4al_dsp_register_name()

static const char * sh_sh4al_dsp_register_name ( struct gdbarch * gdbarch,
int reg_nr )
static

Definition at line 361 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_sh_dsp_register_name()

static const char * sh_sh_dsp_register_name ( struct gdbarch * gdbarch,
int reg_nr )
static

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

Referenced by sh_gdbarch_init().

◆ sh_sh_register_name()

static const char * sh_sh_register_name ( struct gdbarch * gdbarch,
int reg_nr )
static

Definition at line 110 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_skip_prologue()

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

◆ sh_stack_allocsize()

static CORE_ADDR sh_stack_allocsize ( int nargs,
struct value ** args )
static

Definition at line 896 of file sh-tdep.c.

Referenced by sh_push_dummy_call_fpu(), and sh_push_dummy_call_nofpu().

◆ sh_stack_frame_destroyed_p()

static int sh_stack_frame_destroyed_p ( struct gdbarch * gdbarch,
CORE_ADDR pc )
static

◆ sh_store_return_value_fpu()

static void sh_store_return_value_fpu ( struct type * type,
struct regcache * regcache,
const gdb_byte * valbuf )
static

◆ sh_store_return_value_nofpu()

static void sh_store_return_value_nofpu ( struct type * type,
struct regcache * regcache,
const gdb_byte * valbuf )
static

◆ sh_stub_this_id()

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

◆ sh_stub_unwind_sniffer()

static int sh_stub_unwind_sniffer ( const struct frame_unwind * self,
frame_info_ptr this_frame,
void ** this_prologue_cache )
static

Definition at line 1985 of file sh-tdep.c.

References get_frame_address_in_block(), and in_plt_section().

◆ sh_sw_breakpoint_from_kind()

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

Definition at line 390 of file sh-tdep.c.

References gdbarch_byte_order(), size, and target_shortname().

Referenced by sh_gdbarch_init().

◆ sh_treat_as_flt_p()

static int sh_treat_as_flt_p ( struct type * type)
static

◆ sh_use_struct_convention()

static int sh_use_struct_convention ( int renesas_abi,
struct type * type )
static

◆ sh_use_struct_convention_nofpu()

static int sh_use_struct_convention_nofpu ( int renesas_abi,
struct type * type )
static

Definition at line 809 of file sh-tdep.c.

References type::length(), type::num_fields(), and sh_use_struct_convention().

Referenced by sh_return_value_nofpu().

Variable Documentation

◆ flt_argreg_array

int flt_argreg_array[FLOAT_ARGLAST_REGNUM - FLOAT_ARG0_REGNUM+1]
static

Definition at line 909 of file sh-tdep.c.

Referenced by sh_init_flt_argreg(), and sh_next_flt_argreg().

◆ setshcmdlist

struct cmd_list_element* setshcmdlist = NULL
static

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

Referenced by _initialize_sh_tdep().

◆ sh_active_calling_convention

const char* sh_active_calling_convention = sh_cc_gcc
static

Definition at line 67 of file sh-tdep.c.

Referenced by _initialize_sh_tdep(), and sh_is_renesas_calling_convention().

◆ sh_cc_enum

const char* const sh_cc_enum[]
static
Initial value:
= {
NULL
}
static const char sh_cc_gcc[]
Definition sh-tdep.c:59
static const char sh_cc_renesas[]
Definition sh-tdep.c:60

Definition at line 61 of file sh-tdep.c.

Referenced by _initialize_sh_tdep().

◆ sh_cc_gcc

const char sh_cc_gcc[] = "gcc"
static

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

◆ sh_cc_renesas

const char sh_cc_renesas[] = "renesas"
static

Definition at line 60 of file sh-tdep.c.

Referenced by sh_is_renesas_calling_convention().

◆ sh_corefile_fpregset

const struct regset sh_corefile_fpregset
static
Initial value:
=
{
NULL,
}
void sh_corefile_supply_regset(const struct regset *regset, struct regcache *regcache, int regnum, const void *regs, size_t len)
Definition sh-tdep.c:2106
void sh_corefile_collect_regset(const struct regset *regset, const struct regcache *regcache, int regnum, void *regs, size_t len)
Definition sh-tdep.c:2132

Definition at line 2162 of file sh-tdep.c.

Referenced by sh_iterate_over_regset_sections().

◆ sh_corefile_gregset

const struct regset sh_corefile_gregset

◆ sh_frame_base

const struct frame_base sh_frame_base
static
Initial value:
= {
}
static const struct frame_unwind sh_frame_unwind
Definition sh-tdep.c:1932
static CORE_ADDR sh_frame_base_address(frame_info_ptr this_frame, void **this_cache)
Definition sh-tdep.c:1943

Definition at line 1950 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_frame_unwind

const struct frame_unwind sh_frame_unwind
static
Initial value:
= {
"sh 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 void sh_frame_this_id(frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
Definition sh-tdep.c:1920
static struct value * sh_frame_prev_register(frame_info_ptr this_frame, void **this_cache, int regnum)
Definition sh-tdep.c:1895

Definition at line 1932 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ sh_stub_unwind

const struct frame_unwind sh_stub_unwind
static
Initial value:
=
{
"sh stub",
NULL,
}
static void sh_stub_this_id(frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
Definition sh-tdep.c:1972
static int sh_stub_unwind_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
Definition sh-tdep.c:1985

Definition at line 1998 of file sh-tdep.c.

Referenced by sh_gdbarch_init().

◆ showshcmdlist

struct cmd_list_element* showshcmdlist = NULL
static

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

Referenced by _initialize_sh_tdep().