GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
s12z-tdep.c File Reference
#include "defs.h"
#include "arch-utils.h"
#include "dwarf2/frame.h"
#include "gdbsupport/errors.h"
#include "frame-unwind.h"
#include "gdbcore.h"
#include "gdbcmd.h"
#include "inferior.h"
#include "opcode/s12z.h"
#include "trad-frame.h"
#include "remote.h"
#include "opcodes/s12z-opc.h"
#include "gdbarch.h"
#include "disasm.h"

Go to the source code of this file.

Classes

struct  mem_read_abstraction
 

Macros

#define N_PHYSICAL_REGISTERS   (S12Z_N_REGISTERS - 2)
 

Functions

static const char * s12z_register_name (struct gdbarch *gdbarch, int regnum)
 
static CORE_ADDR s12z_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
 
static struct types12z_register_type (struct gdbarch *gdbarch, int reg_nr)
 
static int s12z_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int num)
 
static void advance (struct mem_read_abstraction_base *b)
 
static bfd_vma posn (struct mem_read_abstraction_base *b)
 
static int abstract_read_memory (struct mem_read_abstraction_base *b, int offset, size_t n, bfd_byte *bytes)
 
static int push_pull_get_stack_adjustment (int n_operands, struct operand *const *operands)
 
static struct trad_frame_caches12z_frame_cache (frame_info_ptr this_frame, void **prologue_cache)
 
static void s12z_frame_this_id (frame_info_ptr this_frame, void **prologue_cache, struct frame_id *this_id)
 
static struct values12z_frame_prev_register (frame_info_ptr this_frame, void **prologue_cache, int regnum)
 
typedef BP_MANIPULATION (s12z_break_insn)
 
static void s12z_print_ccw_info (struct gdbarch *gdbarch, struct ui_file *file, frame_info_ptr frame, int reg)
 
static void s12z_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, frame_info_ptr frame, int regnum, int print_all)
 
static void s12z_extract_return_value (struct type *type, struct regcache *regcache, void *valbuf)
 
static enum return_value_convention s12z_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
 
static void show_bdccsr_command (const char *args, int from_tty)
 
static struct gdbarchs12z_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
void _initialize_s12z_tdep ()
 

Variables

static const int reg_perm [N_PHYSICAL_REGISTERS]
 
static const int inv_reg_perm [N_PHYSICAL_REGISTERS]
 
static const struct frame_unwind s12z_frame_unwind
 
constexpr gdb_byte s12z_break_insn [] = {0x00}
 
static const char ccw_bits []
 

Macro Definition Documentation

◆ N_PHYSICAL_REGISTERS

#define N_PHYSICAL_REGISTERS   (S12Z_N_REGISTERS - 2)

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

Referenced by s12z_gdbarch_init().

Function Documentation

◆ _initialize_s12z_tdep()

void _initialize_s12z_tdep ( )

Definition at line 667 of file s12z-tdep.c.

References gdbarch_register(), and s12z_gdbarch_init().

◆ abstract_read_memory()

static int abstract_read_memory ( struct mem_read_abstraction_base * b,
int offset,
size_t n,
bfd_byte * bytes )
static

Definition at line 173 of file s12z-tdep.c.

References mem_read_abstraction::info, mem_read_abstraction::memaddr, and status.

Referenced by s12z_frame_cache().

◆ advance()

static void advance ( struct mem_read_abstraction_base * b)
static

Definition at line 155 of file s12z-tdep.c.

References mem_read_abstraction::memaddr.

Referenced by s12z_frame_cache().

◆ BP_MANIPULATION()

typedef BP_MANIPULATION ( s12z_break_insn )

Definition at line 459 of file s12z-tdep.c.

◆ posn()

static bfd_vma posn ( struct mem_read_abstraction_base * b)
static

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

References mem_read_abstraction::memaddr.

Referenced by ada_print_scalar(), ada_val_print_enum(), and s12z_frame_cache().

◆ push_pull_get_stack_adjustment()

static int push_pull_get_stack_adjustment ( int n_operands,
struct operand *const * operands )
static

Definition at line 195 of file s12z-tdep.c.

Referenced by s12z_frame_cache().

◆ s12z_dwarf_reg_to_regnum()

static int s12z_dwarf_reg_to_regnum ( struct gdbarch * gdbarch,
int num )
static

Definition at line 122 of file s12z-tdep.c.

Referenced by s12z_gdbarch_init().

◆ s12z_extract_return_value()

static void s12z_extract_return_value ( struct type * type,
struct regcache * regcache,
void * valbuf )
static

Definition at line 555 of file s12z-tdep.c.

References readable_regcache::cooked_read(), inv_reg_perm, type::length(), and value::reg.

Referenced by s12z_return_value().

◆ s12z_frame_cache()

static struct trad_frame_cache * s12z_frame_cache ( frame_info_ptr this_frame,
void ** prologue_cache )
static

◆ s12z_frame_prev_register()

static struct value * s12z_frame_prev_register ( frame_info_ptr this_frame,
void ** prologue_cache,
int regnum )
static

◆ s12z_frame_this_id()

static void s12z_frame_this_id ( frame_info_ptr this_frame,
void ** prologue_cache,
struct frame_id * this_id )
static

◆ s12z_gdbarch_init()

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

◆ s12z_print_ccw_info()

static void s12z_print_ccw_info ( struct gdbarch * gdbarch,
struct ui_file * file,
frame_info_ptr frame,
int reg )
static

◆ s12z_print_registers_info()

static void s12z_print_registers_info ( struct gdbarch * gdbarch,
struct ui_file * file,
frame_info_ptr frame,
int regnum,
int print_all )
static

◆ s12z_register_name()

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

Definition at line 76 of file s12z-tdep.c.

References reg_perm, and regnum.

Referenced by s12z_gdbarch_init().

◆ s12z_register_type()

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

◆ s12z_return_value()

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

◆ s12z_skip_prologue()

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

Definition at line 83 of file s12z-tdep.c.

References find_pc_partial_function(), and skip_prologue_using_sal().

Referenced by s12z_frame_cache(), and s12z_gdbarch_init().

◆ show_bdccsr_command()

static void show_bdccsr_command ( const char * args,
int from_tty )
static

Definition at line 608 of file s12z-tdep.c.

References gdb_printf(), string_file::string(), and target_rcmd().

Referenced by s12z_gdbarch_init().

Variable Documentation

◆ ccw_bits

const char ccw_bits[]
static
Initial value:
=
{
'C',
'V',
'Z',
'N',
'I',
'-',
'X',
'S',
'0',
'0',
'0',
'-',
'-',
'-',
'-',
'U'
}

Definition at line 468 of file s12z-tdep.c.

Referenced by s12z_print_ccw_info().

◆ inv_reg_perm

const int inv_reg_perm[N_PHYSICAL_REGISTERS]
static
Initial value:
=
{
2, 3, 4, 5,
0, 1,
6, 7,
8, 9, 10, 11, 12
}

Definition at line 66 of file s12z-tdep.c.

Referenced by s12z_extract_return_value().

◆ reg_perm

const int reg_perm[N_PHYSICAL_REGISTERS]
static
Initial value:
=
{
REG_D0,
REG_D1,
REG_D2,
REG_D3,
REG_D4,
REG_D5,
REG_D6,
REG_D7,
REG_X,
REG_Y,
REG_S,
REG_P,
REG_CCW
}

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

Referenced by s12z_print_registers_info(), s12z_register_name(), and s12z_register_type().

◆ s12z_break_insn

constexpr gdb_byte s12z_break_insn[] = {0x00}
constexpr

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

◆ s12z_frame_unwind

const struct frame_unwind s12z_frame_unwind
static
Initial value:
= {
"s12z prologue",
NULL,
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 s12z_frame_this_id(frame_info_ptr this_frame, void **prologue_cache, struct frame_id *this_id)
Definition s12z-tdep.c:423
static struct value * s12z_frame_prev_register(frame_info_ptr this_frame, void **prologue_cache, int regnum)
Definition s12z-tdep.c:435

Definition at line 445 of file s12z-tdep.c.

Referenced by s12z_gdbarch_init().