GDB (xrefs)

Classes | Macros | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/tilegx-tdep.c File Reference
`#include "defs.h"`
`#include "frame.h"`
`#include "frame-base.h"`
`#include "frame-unwind.h"`
`#include "dwarf2-frame.h"`
`#include "trad-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 "regset.h"`
`#include "osabi.h"`
`#include "linux-tdep.h"`
`#include "objfiles.h"`
`#include "solib-svr4.h"`
`#include "tilegx-tdep.h"`
`#include "opcode/tilegx.h"`
`#include <algorithm>`
`#include "common/byte-vector.h"`

Go to the source code of this file.

## Classes
struct | tilegx_frame_cache
struct | tilegx_reverse_regs

## Macros
#define | INT_SWINT_1_SIGRETURN (~0)

## Enumerations
enum | reverse_state { REVERSE_STATE_REGISTER, REVERSE_STATE_VALUE, REVERSE_STATE_UNKNOWN }

## Functions
static const char * | tilegx_register_name (struct gdbarch *gdbarch, int regnum)
static struct type * | tilegx_register_type (struct gdbarch *gdbarch, int regnum)
static int | tilegx_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int num)
static int | tilegx_type_is_scalar (struct type *t)
static int | tilegx_use_struct_convention (struct type *type)
static void | tilegx_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf)
static void | tilegx_store_return_value (struct type *type, struct regcache *regcache, const void *valbuf)
static enum return_value_convention | tilegx_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static CORE_ADDR | tilegx_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
static CORE_ADDR | tilegx_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
static CORE_ADDR | tilegx_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR start_addr, CORE_ADDR end_addr, struct tilegx_frame_cache *cache, struct frame_info *next_frame)
static CORE_ADDR | tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
static int | tilegx_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
static int | tilegx_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
static void | tilegx_write_pc (struct regcache *regcache, CORE_ADDR pc)
typedef | BP_MANIPULATION (tilegx_break_insn)
static struct value * | tilegx_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum)
static void | tilegx_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static CORE_ADDR | tilegx_frame_base_address (struct frame_info *this_frame, void **this_cache)
static CORE_ADDR | tilegx_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
static CORE_ADDR | tilegx_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
static struct frame_id | tilegx_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
static int | tilegx_cannot_reference_register (struct gdbarch *gdbarch, int regno)
static struct gdbarch * | tilegx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
void | _initialize_tilegx_tdep (void)

## Variables
static const struct tilegx_reverse_regs | template_reverse_regs [TILEGX_NUM_PHYS_REGS]
constexpr gdb_byte | tilegx_break_insn []
static const struct frame_unwind | tilegx_frame_unwind
static const struct frame_base | tilegx_frame_base

## Macro Definition Documentation

## ◆ INT_SWINT_1_SIGRETURN

#define INT_SWINT_1_SIGRETURN (~0)

Definition at line 813 of file tilegx-tdep.c.

Referenced by tilegx_write_pc().

## Enumeration Type Documentation

## ◆ reverse_state

enum reverse_state

Enumerator
REVERSE_STATE_REGISTER |
REVERSE_STATE_VALUE |
REVERSE_STATE_UNKNOWN |

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

## Function Documentation

## ◆ _initialize_tilegx_tdep()

void _initialize_tilegx_tdep | ( | void |  | ) |

Definition at line 1062 of file tilegx-tdep.c.

References register_gdbarch_init(), and tilegx_gdbarch_init().

## ◆ BP_MANIPULATION()

typedef BP_MANIPULATION | ( | tilegx_break_insn |  | ) |

Definition at line 844 of file tilegx-tdep.c.

References tilegx_frame_cache::base, FRAME_OBSTACK_ZALLOC, get_frame_arch(), get_frame_func(), get_frame_pc(), get_frame_register_unsigned(), tilegx_frame_cache::saved_regs, tilegx_frame_cache::start_pc, tilegx_analyze_prologue(), TILEGX_LR_REGNUM, TILEGX_PC_REGNUM, TILEGX_SP_REGNUM, trad_frame_alloc_saved_regs(), and trad_frame_set_value().

## ◆ tilegx_analyze_prologue()

static CORE_ADDR tilegx_analyze_prologue | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | start_addr,
|  | CORE_ADDR | end_addr,
|  | struct tilegx_frame_cache * | cache,
|  | struct frame_info * | next_frame
| ) |  |
| static

Definition at line 366 of file tilegx-tdep.c.

References trad_frame_saved_reg::addr, extract_unsigned_integer(), gdbarch_byte_order(), memory_error(), trad_frame_saved_reg::realreg, REVERSE_STATE_REGISTER, REVERSE_STATE_UNKNOWN, REVERSE_STATE_VALUE, safe_frame_unwind_memory(), tilegx_frame_cache::saved_regs, tilegx_reverse_regs::state, status, TARGET_XFER_E_IO, template_reverse_regs, TILEGX_LR_REGNUM, TILEGX_NUM_PHYS_REGS, TILEGX_R52_REGNUM, TILEGX_SP_REGNUM, TILEGX_ZERO_REGNUM, trad_frame_set_value(), and tilegx_reverse_regs::value.

Referenced by BP_MANIPULATION(), and tilegx_skip_prologue().

## ◆ tilegx_cannot_reference_register()

static int tilegx_cannot_reference_register | ( | struct gdbarch * | gdbarch,
|  | int | regno
| ) |  |
| static

Definition at line 959 of file tilegx-tdep.c.

References TILEGX_FAULTNUM_REGNUM, TILEGX_NUM_EASY_REGS, and TILEGX_PC_REGNUM.

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_dwarf2_reg_to_regnum()

static int tilegx_dwarf2_reg_to_regnum | ( | struct gdbarch * | gdbarch,
|  | int | num
| ) |  |
| static

Definition at line 180 of file tilegx-tdep.c.

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_extract_return_value()

static void tilegx_extract_return_value | ( | struct type * | type,
|  | struct regcache * | regcache,
|  | gdb_byte * | valbuf
| ) |  |
| static

Definition at line 215 of file tilegx-tdep.c.

References regcache_raw_read(), regnum, TILEGX_R0_REGNUM, tilegx_reg_size, and TYPE_LENGTH.

Referenced by tilegx_return_value().

## ◆ tilegx_frame_align()

static CORE_ADDR tilegx_frame_align | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 270 of file tilegx-tdep.c.

Referenced by tilegx_gdbarch_init(), and tilegx_push_dummy_call().

## ◆ tilegx_frame_base_address()

static CORE_ADDR tilegx_frame_base_address | ( | struct frame_info * | this_frame,
|  | void ** | this_cache
| ) |  |
| static

Definition at line 908 of file tilegx-tdep.c.

References tilegx_frame_cache::base.

## ◆ tilegx_frame_prev_register()

static struct value* tilegx_frame_prev_register | ( | struct frame_info * | this_frame,
|  | void ** | this_cache,
|  | int | regnum
| ) |  |
| static

Definition at line 880 of file tilegx-tdep.c.

References regnum, tilegx_frame_cache::saved_regs, and trad_frame_get_prev_register().

## ◆ tilegx_frame_this_id()

static void tilegx_frame_this_id | ( | struct frame_info * | this_frame,
|  | void ** | this_cache,
|  | struct frame_id * | this_id
| ) |  |
| static

Definition at line 894 of file tilegx-tdep.c.

References tilegx_frame_cache::base, frame_id_build(), and tilegx_frame_cache::start_pc.

## ◆ tilegx_gdbarch_init()

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

Definition at line 971 of file tilegx-tdep.c.

References gdbarch_info::abfd, core_addr_lessthan(), dwarf2_append_unwinders(), frame_base_set_default(), frame_unwind_append_unwinder(), gdbarch_list::gdbarch, gdbarch_alloc(), gdbarch_init_osabi(), gdbarch_list_lookup_by_info(), gdbarch_ptr_bit(), gdbarch_list::next, set_gdbarch_addr_bit(), set_gdbarch_breakpoint_kind_from_pc(), set_gdbarch_cannot_fetch_register(), set_gdbarch_cannot_store_register(), set_gdbarch_double_bit(), set_gdbarch_dummy_id(), set_gdbarch_dwarf2_reg_to_regnum(), set_gdbarch_float_bit(), set_gdbarch_frame_align(), set_gdbarch_get_longjmp_target(), set_gdbarch_inner_than(), set_gdbarch_int_bit(), 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_ptr_bit(), set_gdbarch_push_dummy_call(), set_gdbarch_register_name(), set_gdbarch_register_type(), 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_unwind_pc(), set_gdbarch_unwind_sp(), set_gdbarch_write_pc(), TARGET_CHAR_BIT, tilegx_cannot_reference_register(), tilegx_dwarf2_reg_to_regnum(), tilegx_frame_align(), tilegx_frame_base, tilegx_frame_unwind, tilegx_get_longjmp_target(), TILEGX_NUM_REGS, TILEGX_PC_REGNUM, tilegx_push_dummy_call(), tilegx_register_name(), tilegx_register_type(), tilegx_return_value(), tilegx_skip_prologue(), TILEGX_SP_REGNUM, tilegx_stack_frame_destroyed_p(), tilegx_unwind_dummy_id(), tilegx_unwind_pc(), tilegx_unwind_sp(), and tilegx_write_pc().

Referenced by _initialize_tilegx_tdep().

## ◆ tilegx_get_longjmp_target()

static int tilegx_get_longjmp_target | ( | struct frame_info * | frame,
|  | CORE_ADDR * | pc
| ) |  |
| static

Definition at line 790 of file tilegx-tdep.c.

References gdbarch::byte_order, extract_unsigned_integer(), gdbarch_byte_order(), get_frame_arch(), get_frame_register_unsigned(), target_read_memory(), and TILEGX_R0_REGNUM.

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_push_dummy_call()

static CORE_ADDR tilegx_push_dummy_call | ( | struct gdbarch * | gdbarch,
|  | struct value * | function,
|  | 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 279 of file tilegx-tdep.c.

References align_up(), extract_unsigned_integer(), gdbarch_byte_order(), memset(), regcache_cooked_write_unsigned(), tilegx_frame_align(), TILEGX_LR_REGNUM, TILEGX_R0_REGNUM, TILEGX_R9_REGNUM, tilegx_reg_size, TILEGX_SP_REGNUM, TYPE_LENGTH, value_contents(), value_enclosing_type(), and write_memory().

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_register_name()

static const char* tilegx_register_name | ( | struct gdbarch * | gdbarch,
|  | int | regnum
| ) |  |
| static

Definition at line 143 of file tilegx-tdep.c.

References internal_error(), regnum, and TILEGX_NUM_REGS.

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_register_type()

static struct type* tilegx_register_type | ( | struct gdbarch * | gdbarch,
|  | int | regnum
| ) |  |
| static

Definition at line 169 of file tilegx-tdep.c.

References builtin_type::builtin_func_ptr, builtin_type(), builtin_type::builtin_uint64, regnum, and TILEGX_PC_REGNUM.

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_return_value()

static enum return_value_convention tilegx_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 254 of file tilegx-tdep.c.

References RETURN_VALUE_REGISTER_CONVENTION, RETURN_VALUE_STRUCT_CONVENTION, tilegx_extract_return_value(), tilegx_store_return_value(), and tilegx_use_struct_convention().

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_skip_prologue()

static CORE_ADDR tilegx_skip_prologue | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | start_pc
| ) |  |
| static

Definition at line 739 of file tilegx-tdep.c.

References find_pc_partial_function(), find_pc_section(), obj_section_endaddr, skip_prologue_using_sal(), and tilegx_analyze_prologue().

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_stack_frame_destroyed_p()

static int tilegx_stack_frame_destroyed_p | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | pc
| ) |  |
| static

Definition at line 771 of file tilegx-tdep.c.

References find_pc_partial_function().

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_store_return_value()

static void tilegx_store_return_value | ( | struct type * | type,
|  | struct regcache * | regcache,
|  | const void * | valbuf
| ) |  |
| static

Definition at line 230 of file tilegx-tdep.c.

References regcache_raw_write(), regnum, TILEGX_R0_REGNUM, tilegx_reg_size, and TYPE_LENGTH.

Referenced by tilegx_return_value().

## ◆ tilegx_type_is_scalar()

static int tilegx_type_is_scalar | ( | struct type * | t | ) |
| static

Definition at line 189 of file tilegx-tdep.c.

References TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_STRUCT, and TYPE_CODE_UNION.

Referenced by tilegx_use_struct_convention().

## ◆ tilegx_unwind_dummy_id()

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

Definition at line 946 of file tilegx-tdep.c.

References frame_id_build(), get_frame_pc(), get_frame_register_unsigned(), and TILEGX_SP_REGNUM.

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_unwind_pc()

static CORE_ADDR tilegx_unwind_pc | ( | struct gdbarch * | gdbarch,
|  | struct frame_info * | next_frame
| ) |  |
| static

Definition at line 940 of file tilegx-tdep.c.

References frame_unwind_register_unsigned(), and TILEGX_PC_REGNUM.

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_unwind_sp()

static CORE_ADDR tilegx_unwind_sp | ( | struct gdbarch * | gdbarch,
|  | struct frame_info * | next_frame
| ) |  |
| static

Definition at line 934 of file tilegx-tdep.c.

References frame_unwind_register_unsigned(), and TILEGX_SP_REGNUM.

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_use_struct_convention()

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

Definition at line 202 of file tilegx-tdep.c.

References TILEGX_R0_REGNUM, TILEGX_R9_REGNUM, tilegx_reg_size, tilegx_type_is_scalar(), and TYPE_LENGTH.

Referenced by tilegx_return_value().

## ◆ tilegx_write_pc()

static void tilegx_write_pc | ( | struct regcache * | regcache,
|  | CORE_ADDR | pc
| ) |  |
| static

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

References INT_SWINT_1_SIGRETURN, regcache_cooked_write_unsigned(), TILEGX_FAULTNUM_REGNUM, and TILEGX_PC_REGNUM.

Referenced by tilegx_gdbarch_init().

## Variable Documentation

## ◆ template_reverse_regs

const struct tilegx_reverse_regs template_reverse_regs[TILEGX_NUM_PHYS_REGS]
| static

Definition at line 72 of file tilegx-tdep.c.

Referenced by tilegx_analyze_prologue().

## ◆ tilegx_break_insn

constexpr gdb_byte tilegx_break_insn[]

Initial value:
=
{ 0x00, 0x50, 0x48, 0x51, 0xae, 0x44, 0x6a, 0x28 }

Definition at line 841 of file tilegx-tdep.c.

## ◆ tilegx_frame_base

const struct frame_base tilegx_frame_base
| static

Initial value:
= {
&tilegx_frame_unwind,
tilegx_frame_base_address,
tilegx_frame_base_address,
tilegx_frame_base_address
}
tilegx_frame_base_address
static CORE_ADDR tilegx_frame_base_address(struct frame_info *this_frame, void **this_cache)
Definition: tilegx-tdep.c:908
tilegx_frame_unwind
static const struct frame_unwind tilegx_frame_unwind
Definition: tilegx-tdep.c:916

Definition at line 926 of file tilegx-tdep.c.

Referenced by tilegx_gdbarch_init().

## ◆ tilegx_frame_unwind

const struct frame_unwind tilegx_frame_unwind
| static

Initial value:
= {
NORMAL_FRAME,
default_frame_unwind_stop_reason,
tilegx_frame_this_id,
tilegx_frame_prev_register,
NULL,
default_frame_sniffer,
NULL
}
NORMAL_FRAME
Definition: frame.h:244
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
tilegx_frame_this_id
static void tilegx_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
Definition: tilegx-tdep.c:894
tilegx_frame_prev_register
static struct value * tilegx_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
Definition: tilegx-tdep.c:880
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 916 of file tilegx-tdep.c.

Referenced by tilegx_gdbarch_init().