GDB (xrefs)

Classes | Macros | Functions | Variables
/tmp/gdb-8.1/gdb/lm32-tdep.c File Reference
`#include "defs.h"`
`#include "frame.h"`
`#include "frame-unwind.h"`
`#include "frame-base.h"`
`#include "inferior.h"`
`#include "dis-asm.h"`
`#include "symfile.h"`
`#include "remote.h"`
`#include "gdbcore.h"`
`#include "gdb/sim-lm32.h"`
`#include "gdb/callback.h"`
`#include "gdb/remote-sim.h"`
`#include "sim-regno.h"`
`#include "arch-utils.h"`
`#include "regcache.h"`
`#include "trad-frame.h"`
`#include "reggroups.h"`
`#include "opcodes/lm32-desc.h"`
`#include <algorithm>`

Go to the source code of this file.

## Classes
struct | gdbarch_tdep
struct | lm32_frame_cache

## Macros
#define | LM32_OPCODE(insn) ((insn >> 26) & 0x3f)
#define | LM32_REG0(insn) ((insn >> 21) & 0x1f)
#define | LM32_REG1(insn) ((insn >> 16) & 0x1f)
#define | LM32_REG2(insn) ((insn >> 11) & 0x1f)
#define | LM32_IMM16(insn) ((((long)insn & 0xffff) << 16) >> 16)

## Functions
static void | lm32_add_reggroups (struct gdbarch *gdbarch)
static int | lm32_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *group)
static const char * | lm32_register_name (struct gdbarch *gdbarch, int reg_nr)
static struct type * | lm32_register_type (struct gdbarch *gdbarch, int reg_nr)
static int | lm32_cannot_store_register (struct gdbarch *gdbarch, int regno)
static CORE_ADDR | lm32_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR limit, struct lm32_frame_cache *info)
static CORE_ADDR | lm32_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
typedef | BP_MANIPULATION (lm32_break_insn)
static void | lm32_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf)
static void | lm32_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
static enum return_value_convention | lm32_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static CORE_ADDR | lm32_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
static CORE_ADDR | lm32_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
static struct frame_id | lm32_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
static struct lm32_frame_cache * | lm32_frame_cache (struct frame_info *this_frame, void **this_prologue_cache)
static void | lm32_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static struct value * | lm32_frame_prev_register (struct frame_info *this_frame, void **this_prologue_cache, int regnum)
static CORE_ADDR | lm32_frame_base_address (struct frame_info *this_frame, void **this_cache)
static CORE_ADDR | lm32_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
static struct gdbarch * | lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
void | _initialize_lm32_tdep (void)

## Variables
constexpr gdb_byte | lm32_break_insn [4] = { OP_RAISE << 2, 0, 0, 2 }
static const struct frame_unwind | lm32_frame_unwind
static const struct frame_base | lm32_frame_base

## Macro Definition Documentation

## ◆ LM32_IMM16

#define LM32_IMM16 | ( |  | insn | ) | ((((long)insn & 0xffff) << 16) >> 16)

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

Referenced by lm32_analyze_prologue().

## ◆ LM32_OPCODE

#define LM32_OPCODE | ( |  | insn | ) | ((insn >> 26) & 0x3f)

Definition at line 42 of file lm32-tdep.c.

Referenced by lm32_analyze_prologue().

## ◆ LM32_REG0

#define LM32_REG0 | ( |  | insn | ) | ((insn >> 21) & 0x1f)

Definition at line 43 of file lm32-tdep.c.

Referenced by lm32_analyze_prologue().

## ◆ LM32_REG1

#define LM32_REG1 | ( |  | insn | ) | ((insn >> 16) & 0x1f)

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

Referenced by lm32_analyze_prologue().

## ◆ LM32_REG2

#define LM32_REG2 | ( |  | insn | ) | ((insn >> 11) & 0x1f)

Definition at line 45 of file lm32-tdep.c.

Referenced by lm32_analyze_prologue().

## Function Documentation

## ◆ _initialize_lm32_tdep()

void _initialize_lm32_tdep | ( | void |  | ) |

Definition at line 575 of file lm32-tdep.c.

References lm32_gdbarch_init(), and register_gdbarch_init().

## ◆ BP_MANIPULATION()

typedef BP_MANIPULATION | ( | lm32_break_insn |  | ) |

Definition at line 221 of file lm32-tdep.c.

References builtin_type::builtin_int32, builtin_type(), check_typedef(), extract_unsigned_integer(), gdbarch_byte_order(), regcache_cooked_write_signed(), regcache_cooked_write_unsigned(), TYPE_CODE, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_ENUM, TYPE_CODE_INT, TYPE_CODE_RANGE, TYPE_LENGTH, value_cast(), value_contents(), value_type(), and write_memory_unsigned_integer().

## ◆ lm32_add_reggroups()

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

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

References all_reggroup, general_reggroup, reggroup_add(), and system_reggroup.

Referenced by lm32_gdbarch_init().

## ◆ lm32_analyze_prologue()

static CORE_ADDR lm32_analyze_prologue | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | pc,
|  | CORE_ADDR | limit,
|  | struct lm32_frame_cache * | info
| ) |  |
| static

Definition at line 127 of file lm32-tdep.c.

References trad_frame_saved_reg::addr, gdbarch_byte_order(), LM32_IMM16, LM32_OPCODE, LM32_REG0, LM32_REG1, LM32_REG2, read_memory_integer(), lm32_frame_cache::saved_regs, and lm32_frame_cache::size.

Referenced by lm32_frame_cache(), and lm32_skip_prologue().

## ◆ lm32_cannot_store_register()

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

Definition at line 119 of file lm32-tdep.c.

Referenced by lm32_gdbarch_init().

## ◆ lm32_dummy_id()

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

Definition at line 398 of file lm32-tdep.c.

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

Referenced by lm32_gdbarch_init().

## ◆ lm32_extract_return_value()

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

Definition at line 303 of file lm32-tdep.c.

References regcache::arch(), gdbarch::byte_order, gdbarch_byte_order(), read_memory(), regcache_cooked_read_unsigned(), store_unsigned_integer(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_INT, TYPE_CODE_STRUCT, TYPE_CODE_UNION, and TYPE_LENGTH.

Referenced by lm32_return_value().

## ◆ lm32_frame_align()

static CORE_ADDR lm32_frame_align | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | sp
| ) |  |
| static

Definition at line 505 of file lm32-tdep.c.

Referenced by lm32_gdbarch_init().

## ◆ lm32_frame_base_address()

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

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

References lm32_frame_cache::base, and lm32_frame_cache().

## ◆ lm32_frame_cache()

static struct lm32_frame_cache* lm32_frame_cache | ( | struct frame_info * | this_frame,
|  | void ** | this_prologue_cache
| ) |  |
| static

Definition at line 412 of file lm32-tdep.c.

References trad_frame_saved_reg::addr, lm32_frame_cache::base, FRAME_OBSTACK_ZALLOC, gdbarch_num_regs(), get_frame_arch(), get_frame_func(), get_frame_pc(), get_frame_register_unsigned(), lm32_analyze_prologue(), lm32_frame_cache::pc, lm32_frame_cache::saved_regs, lm32_frame_cache::size, trad_frame_addr_p(), trad_frame_alloc_saved_regs(), and trad_frame_set_value().

Referenced by lm32_frame_base_address(), lm32_frame_prev_register(), and lm32_frame_this_id().

## ◆ lm32_frame_prev_register()

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

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

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

## ◆ lm32_frame_this_id()

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

Definition at line 458 of file lm32-tdep.c.

References lm32_frame_cache::base, frame_id_build(), lm32_frame_cache(), and lm32_frame_cache::pc.

## ◆ lm32_gdbarch_init()

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

Definition at line 513 of file lm32-tdep.c.

References core_addr_lessthan(), frame_base_set_default(), frame_unwind_append_unwinder(), gdbarch_list::gdbarch, gdbarch_alloc(), gdbarch_list_lookup_by_info(), lm32_add_reggroups(), lm32_cannot_store_register(), lm32_dummy_id(), lm32_frame_align(), lm32_frame_base, lm32_frame_unwind, lm32_register_name(), lm32_register_reggroup_p(), lm32_register_type(), lm32_return_value(), lm32_skip_prologue(), lm32_unwind_pc(), lm32_unwind_sp(), set_gdbarch_breakpoint_kind_from_pc(), set_gdbarch_cannot_store_register(), set_gdbarch_decr_pc_after_break(), set_gdbarch_double_bit(), set_gdbarch_dummy_id(), set_gdbarch_float_bit(), set_gdbarch_frame_align(), set_gdbarch_frame_args_skip(), 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_long_bit(), set_gdbarch_num_regs(), set_gdbarch_pc_regnum(), set_gdbarch_ptr_bit(), set_gdbarch_push_dummy_call(), set_gdbarch_register_name(), set_gdbarch_register_reggroup_p(), set_gdbarch_register_type(), set_gdbarch_return_value(), set_gdbarch_short_bit(), set_gdbarch_skip_prologue(), set_gdbarch_sp_regnum(), set_gdbarch_sw_breakpoint_from_kind(), set_gdbarch_unwind_pc(), set_gdbarch_unwind_sp(), and XCNEW.

Referenced by _initialize_lm32_tdep().

## ◆ lm32_register_name()

static const char* lm32_register_name | ( | struct gdbarch * | gdbarch,
|  | int | reg_nr
| ) |  |
| static

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

Referenced by lm32_gdbarch_init().

## ◆ lm32_register_reggroup_p()

static int lm32_register_reggroup_p | ( | struct gdbarch * | gdbarch,
|  | int | regnum,
|  | struct reggroup * | group
| ) |  |
| static

Definition at line 77 of file lm32-tdep.c.

References default_register_reggroup_p(), general_reggroup, regnum, and system_reggroup.

Referenced by lm32_gdbarch_init().

## ◆ lm32_register_type()

static struct type* lm32_register_type | ( | struct gdbarch * | gdbarch,
|  | int | reg_nr
| ) |  |
| static

Definition at line 111 of file lm32-tdep.c.

References builtin_type::builtin_int32, and builtin_type().

Referenced by lm32_gdbarch_init().

## ◆ lm32_return_value()

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

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

References code, lm32_extract_return_value(), lm32_store_return_value(), RETURN_VALUE_REGISTER_CONVENTION, RETURN_VALUE_STRUCT_CONVENTION, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_STRUCT, TYPE_CODE_UNION, and TYPE_LENGTH.

Referenced by lm32_gdbarch_init().

## ◆ lm32_skip_prologue()

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

Definition at line 187 of file lm32-tdep.c.

References find_pc_partial_function(), lm32_analyze_prologue(), and skip_prologue_using_sal().

Referenced by lm32_gdbarch_init().

## ◆ lm32_store_return_value()

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

Definition at line 340 of file lm32-tdep.c.

References _, regcache::arch(), gdbarch::byte_order, error(), extract_unsigned_integer(), gdbarch_byte_order(), regcache_cooked_write_unsigned(), and TYPE_LENGTH.

Referenced by lm32_return_value().

## ◆ lm32_unwind_pc()

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

Definition at line 386 of file lm32-tdep.c.

References frame_unwind_register_unsigned().

Referenced by lm32_gdbarch_init().

## ◆ lm32_unwind_sp()

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

Definition at line 392 of file lm32-tdep.c.

References frame_unwind_register_unsigned().

Referenced by lm32_gdbarch_init().

## Variable Documentation

## ◆ lm32_break_insn

constexpr gdb_byte lm32_break_insn[4] = { OP_RAISE << 2, 0, 0, 2 }

Definition at line 219 of file lm32-tdep.c.

## ◆ lm32_frame_base

const struct frame_base lm32_frame_base
| static

Initial value:
= {
&lm32_frame_unwind,
lm32_frame_base_address,
lm32_frame_base_address,
lm32_frame_base_address
}
lm32_frame_unwind
static const struct frame_unwind lm32_frame_unwind
Definition: lm32-tdep.c:480
lm32_frame_base_address
static CORE_ADDR lm32_frame_base_address(struct frame_info *this_frame, void **this_cache)
Definition: lm32-tdep.c:490

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

Referenced by lm32_gdbarch_init().

## ◆ lm32_frame_unwind

const struct frame_unwind lm32_frame_unwind
| static

Initial value:
= {
NORMAL_FRAME,
default_frame_unwind_stop_reason,
lm32_frame_this_id,
lm32_frame_prev_register,
NULL,
default_frame_sniffer
}
lm32_frame_this_id
static void lm32_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
Definition: lm32-tdep.c:458
NORMAL_FRAME
Definition: frame.h:244
lm32_frame_prev_register
static struct value * lm32_frame_prev_register(struct frame_info *this_frame, void **this_prologue_cache, int regnum)
Definition: lm32-tdep.c:471
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
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 480 of file lm32-tdep.c.

Referenced by lm32_gdbarch_init().