GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Functions | Variables
or1k-tdep.c File Reference
#include "defs.h"
#include "frame.h"
#include "inferior.h"
#include "symtab.h"
#include "value.h"
#include "gdbcmd.h"
#include "language.h"
#include "gdbcore.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdbtypes.h"
#include "target.h"
#include "regcache.h"
#include "gdbsupport/gdb-safe-ctype.h"
#include "reggroups.h"
#include "arch-utils.h"
#include "frame-unwind.h"
#include "frame-base.h"
#include "dwarf2/frame.h"
#include "trad-frame.h"
#include "regset.h"
#include "remote.h"
#include "target-descriptions.h"
#include <inttypes.h>
#include "dis-asm.h"
#include "gdbarch.h"
#include "or1k-tdep.h"
#include "features/or1k.c"

Go to the source code of this file.

Classes

struct  or1k_gdbarch_tdep
 

Functions

static void show_or1k_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static ULONGEST or1k_fetch_instruction (struct gdbarch *gdbarch, CORE_ADDR addr)
 
static bool or1k_analyse_inst (uint32_t inst, const char *format,...)
 
static bool or1k_analyse_l_addi (uint32_t inst, unsigned int *rd_ptr, unsigned int *ra_ptr, int *simm_ptr)
 
static bool or1k_analyse_l_sw (uint32_t inst, int *simm_ptr, unsigned int *ra_ptr, unsigned int *rb_ptr)
 
static enum return_value_convention or1k_return_value (struct gdbarch *gdbarch, struct value *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
 
typedef BP_MANIPULATION (or1k_break_insn)
 
static int or1k_single_step_through_delay (struct gdbarch *gdbarch, frame_info_ptr this_frame)
 
std::vector< CORE_ADDR > or1k_software_single_step (struct regcache *regcache)
 
static int or1k_is_arg_reg (unsigned int regnum)
 
static int or1k_is_callee_saved_reg (unsigned int regnum)
 
static CORE_ADDR or1k_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
 
static CORE_ADDR or1k_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
 
static CORE_ADDR or1k_unwind_pc (struct gdbarch *gdbarch, frame_info_ptr next_frame)
 
static CORE_ADDR or1k_unwind_sp (struct gdbarch *gdbarch, frame_info_ptr next_frame)
 
static CORE_ADDR or1k_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR function, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache)
 
static CORE_ADDR or1k_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 struct trad_frame_cacheor1k_frame_cache (frame_info_ptr this_frame, void **prologue_cache)
 
static void or1k_frame_this_id (frame_info_ptr this_frame, void **prologue_cache, struct frame_id *this_id)
 
static struct valueor1k_frame_prev_register (frame_info_ptr this_frame, void **prologue_cache, int regnum)
 
static struct gdbarchor1k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
static void or1k_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
 
void _initialize_or1k_tdep ()
 

Variables

static bool or1k_debug = false
 
constexpr gdb_byte or1k_break_insn [] = {0x21, 0x00, 0x00, 0x01}
 
static const char *const or1k_reg_names [OR1K_NUM_REGS]
 
static const struct frame_unwind or1k_frame_unwind
 

Function Documentation

◆ _initialize_or1k_tdep()

void _initialize_or1k_tdep ( )

◆ BP_MANIPULATION()

typedef BP_MANIPULATION ( or1k_break_insn )

Definition at line 348 of file or1k-tdep.c.

References or1k_gdbarch_tdep::gdb_cgen_cpu_desc, and or1k_fetch_instruction().

◆ or1k_analyse_inst()

static bool or1k_analyse_inst ( uint32_t inst,
const char * format,
... )
static

Definition at line 92 of file or1k-tdep.c.

References bits, and OR1K_INSTBITLEN.

Referenced by or1k_analyse_l_addi(), and or1k_analyse_l_sw().

◆ or1k_analyse_l_addi()

static bool or1k_analyse_l_addi ( uint32_t inst,
unsigned int * rd_ptr,
unsigned int * ra_ptr,
int * simm_ptr )
static

Definition at line 183 of file or1k-tdep.c.

References or1k_analyse_inst().

Referenced by or1k_frame_cache(), and or1k_skip_prologue().

◆ or1k_analyse_l_sw()

static bool or1k_analyse_l_sw ( uint32_t inst,
int * simm_ptr,
unsigned int * ra_ptr,
unsigned int * rb_ptr )
static

Definition at line 214 of file or1k-tdep.c.

References or1k_analyse_inst().

Referenced by or1k_frame_cache(), and or1k_skip_prologue().

◆ or1k_dump_tdep()

static void or1k_dump_tdep ( struct gdbarch * gdbarch,
struct ui_file * file )
static

◆ or1k_fetch_instruction()

static ULONGEST or1k_fetch_instruction ( struct gdbarch * gdbarch,
CORE_ADDR addr )
static

◆ or1k_frame_align()

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

Definition at line 553 of file or1k-tdep.c.

References OR1K_STACK_ALIGN.

Referenced by or1k_gdbarch_init(), and or1k_push_dummy_code().

◆ or1k_frame_cache()

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

◆ or1k_frame_prev_register()

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

◆ or1k_frame_this_id()

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

◆ or1k_gdbarch_init()

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

Definition at line 1142 of file or1k-tdep.c.

References arches, or1k_gdbarch_tdep::bytes_per_address, or1k_gdbarch_tdep::bytes_per_word, core_addr_lessthan(), dwarf2_append_unwinders(), floatformats_ieee_double, floatformats_ieee_single, frame_unwind_append_unwinder(), or1k_gdbarch_tdep::gdb_cgen_cpu_desc, gdbarch_alloc(), gdbarch_init_osabi(), gdbarch_list_lookup_by_info(), registry< T >::get(), ON_STACK, OR1K_FP_REGNUM, or1k_frame_align(), OR1K_FRAME_RED_ZONE_SIZE, or1k_frame_unwind, OR1K_NPC_REGNUM, OR1K_NUM_PSEUDO_REGS, OR1K_NUM_REGS, or1k_push_dummy_call(), or1k_push_dummy_code(), or1k_reg_names, or1k_return_value(), or1k_single_step_through_delay(), or1k_skip_prologue(), OR1K_SP_REGNUM, OR1K_SR_REGNUM, or1k_unwind_pc(), or1k_unwind_sp(), set_gdbarch_addr_bit(), set_gdbarch_breakpoint_kind_from_pc(), set_gdbarch_call_dummy_location(), set_gdbarch_char_signed(), set_gdbarch_deprecated_fp_regnum(), set_gdbarch_double_bit(), set_gdbarch_double_format(), set_gdbarch_float_bit(), set_gdbarch_float_format(), set_gdbarch_frame_align(), set_gdbarch_frame_red_zone_size(), set_gdbarch_have_nonsteppable_watchpoint(), 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_ps_regnum(), set_gdbarch_ptr_bit(), set_gdbarch_push_dummy_call(), set_gdbarch_push_dummy_code(), set_gdbarch_return_value(), set_gdbarch_short_bit(), set_gdbarch_single_step_through_delay(), set_gdbarch_skip_prologue(), set_gdbarch_sp_regnum(), set_gdbarch_sw_breakpoint_from_kind(), set_gdbarch_unwind_pc(), set_gdbarch_unwind_sp(), tdesc_data, tdesc_data_alloc(), tdesc_find_feature(), tdesc_has_registers(), tdesc_numbered_register(), tdesc_or1k, and tdesc_use_registers().

Referenced by _initialize_or1k_tdep().

◆ or1k_is_arg_reg()

static int or1k_is_arg_reg ( unsigned int regnum)
static

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

References OR1K_FIRST_ARG_REGNUM, OR1K_LAST_ARG_REGNUM, and regnum.

Referenced by or1k_frame_cache(), and or1k_skip_prologue().

◆ or1k_is_callee_saved_reg()

static int or1k_is_callee_saved_reg ( unsigned int regnum)
static

Definition at line 443 of file or1k-tdep.c.

References OR1K_FIRST_SAVED_REGNUM, and regnum.

Referenced by or1k_frame_cache(), and or1k_skip_prologue().

◆ or1k_push_dummy_call()

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

◆ or1k_push_dummy_code()

static CORE_ADDR or1k_push_dummy_code ( struct gdbarch * gdbarch,
CORE_ADDR sp,
CORE_ADDR function,
struct value ** args,
int nargs,
struct type * value_type,
CORE_ADDR * real_pc,
CORE_ADDR * bp_addr,
struct regcache * regcache )
static

Definition at line 601 of file or1k-tdep.c.

References or1k_frame_align().

Referenced by or1k_gdbarch_init().

◆ or1k_return_value()

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

◆ or1k_single_step_through_delay()

static int or1k_single_step_through_delay ( struct gdbarch * gdbarch,
frame_info_ptr this_frame )
static

◆ or1k_skip_prologue()

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

◆ or1k_software_single_step()

std::vector< CORE_ADDR > or1k_software_single_step ( struct regcache * regcache)

Definition at line 408 of file or1k-tdep.c.

References reg_buffer::arch(), and regcache_read_pc().

Referenced by or1k_linux_init_abi().

◆ or1k_unwind_pc()

static CORE_ADDR or1k_unwind_pc ( struct gdbarch * gdbarch,
frame_info_ptr next_frame )
static

◆ or1k_unwind_sp()

static CORE_ADDR or1k_unwind_sp ( struct gdbarch * gdbarch,
frame_info_ptr next_frame )
static

◆ show_or1k_debug()

static void show_or1k_debug ( struct ui_file * file,
int from_tty,
struct cmd_list_element * c,
const char * value )
static

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

References gdb_printf().

Referenced by _initialize_or1k_tdep().

Variable Documentation

◆ or1k_break_insn

constexpr gdb_byte or1k_break_insn[] = {0x21, 0x00, 0x00, 0x01}
constexpr

Definition at line 346 of file or1k-tdep.c.

◆ or1k_debug

bool or1k_debug = false
static

◆ or1k_frame_unwind

const struct frame_unwind or1k_frame_unwind
static
Initial value:
= {
"or1k 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 struct value * or1k_frame_prev_register(frame_info_ptr this_frame, void **prologue_cache, int regnum)
Definition or1k-tdep.c:1117
static void or1k_frame_this_id(frame_info_ptr this_frame, void **prologue_cache, struct frame_id *this_id)
Definition or1k-tdep.c:1105

Definition at line 1128 of file or1k-tdep.c.

Referenced by or1k_gdbarch_init().

◆ or1k_reg_names

const char* const or1k_reg_names[OR1K_NUM_REGS]
static
Initial value:
= {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
"ppc", "npc", "sr"
}

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

Referenced by or1k_gdbarch_init().