#include "target-descriptions.h"
#include "opcodes/microblaze-opcm.h"
#include "opcodes/microblaze-dis.h"
#include "target-descriptions.h"
#include "opcodes/microblaze-opcm.h"
#include "opcodes/microblaze-dis.h"
This set also needs to be verified if it is complete. */
#define IS_RETURN(op) (op == rtsd || op == rtid)
#define IS_UPDATE_SP(op, rd, ra) \
This set also needs to be verified if it is complete. */
#define IS_RETURN(op) (op == rtsd || op == rtid)
#define IS_UPDATE_SP(op, rd, ra) \
#define IS_ALSO_SPILL_REG(op, rd, ra, rb) \
#define IS_ALSO_SPILL_REG(op, rd, ra, rb) \
#define IS_SPILL_REG_FP(op, rd, ra, fpregnum) \
#define IS_SPILL_REG_FP(op, rd, ra, fpregnum) \
#define IS_SAVE_HIDDEN_PTR(op, rd, ra, rb) \
#define IS_SAVE_HIDDEN_PTR(op, rd, ra, rb) \
- ((op == add || op == addik) && ra == MICROBLAZE_FIRST_ARGREG && rb == 0)
-
-/* All registers are 32 bits. */
-#define MICROBLAZE_REGISTER_SIZE 4
+ ((op == add || op == addik) && ra == MICROBLAZE_FIRST_ARGREG && rb == 0)
microblaze_debug (const char *fmt, ...)
{
if (microblaze_debug_flag)
microblaze_debug (const char *fmt, ...)
{
if (microblaze_debug_flag)
/* Analyze the prologue to determine where registers are saved,
the end of the prologue, etc. Return the address of the first line
/* Analyze the prologue to determine where registers are saved,
the end of the prologue, etc. Return the address of the first line
static CORE_ADDR
microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
CORE_ADDR current_pc,
struct microblaze_frame_cache *cache)
{
static CORE_ADDR
microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
CORE_ADDR current_pc,
struct microblaze_frame_cache *cache)
{
CORE_ADDR func_addr, func_end, addr, stop, prologue_end_addr = 0;
unsigned long insn;
CORE_ADDR func_addr, func_end, addr, stop, prologue_end_addr = 0;
unsigned long insn;
enum microblaze_instr op;
int flags = 0;
int save_hidden_pointer_found = 0;
int non_stack_instruction_found = 0;
enum microblaze_instr op;
int flags = 0;
int save_hidden_pointer_found = 0;
int non_stack_instruction_found = 0;
find_pc_partial_function (pc, &name, &func_addr, &func_end);
if (func_addr < pc)
pc = func_addr;
find_pc_partial_function (pc, &name, &func_addr, &func_end);
if (func_addr < pc)
pc = func_addr;
If we're about to return, our frame has already been deallocated.
If we are stopped at the first instruction of a prologue,
If we're about to return, our frame has already been deallocated.
If we are stopped at the first instruction of a prologue,
else if (IS_SETUP_FP(op, ra, rb))
{
/* We have a frame pointer. Note the register which is
else if (IS_SETUP_FP(op, ra, rb))
{
/* We have a frame pointer. Note the register which is
/* When optimizations are enabled, it is not guaranteed that prologue
instructions are not mixed in with other instructions from the
/* When optimizations are enabled, it is not guaranteed that prologue
instructions are not mixed in with other instructions from the
avoided by adding -fno-schedule-insns2 switch as of now (edk 8.1)
In such cases, we scan the function until we see the first control
instruction. */
avoided by adding -fno-schedule-insns2 switch as of now (edk 8.1)
In such cases, we scan the function until we see the first control
instruction. */
microblaze_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
{
struct symtab_and_line sal;
microblaze_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
{
struct symtab_and_line sal;
microblaze_frame_cache (struct frame_info *next_frame, void **this_cache)
{
struct microblaze_frame_cache *cache;
struct gdbarch *gdbarch = get_frame_arch (next_frame);
microblaze_frame_cache (struct frame_info *next_frame, void **this_cache)
{
struct microblaze_frame_cache *cache;
struct gdbarch *gdbarch = get_frame_arch (next_frame);
- return trad_frame_get_prev_register (this_frame, cache->saved_regs, regnum);
+ return trad_frame_get_prev_register (this_frame,
+ cache->saved_regs, regnum);
microblaze_frame_this_id,
microblaze_frame_prev_register,
NULL,
microblaze_frame_this_id,
microblaze_frame_prev_register,
NULL,
{
struct microblaze_frame_cache *cache =
microblaze_frame_cache (next_frame, this_cache);
{
struct microblaze_frame_cache *cache =
microblaze_frame_cache (next_frame, this_cache);
memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 1, 1);
return;
case 2: /* return last 2 bytes in register. */
memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 1, 1);
return;
case 2: /* return last 2 bytes in register. */
memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 2, 2);
return;
case 4: /* for sizes 4 or 8, copy the required length. */
memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 2, 2);
return;
case 4: /* for sizes 4 or 8, copy the required length. */
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
dwarf2_append_unwinders (gdbarch);
frame_unwind_append_unwinder (gdbarch, µblaze_frame_unwind);
frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer);
dwarf2_append_unwinders (gdbarch);
frame_unwind_append_unwinder (gdbarch, µblaze_frame_unwind);
frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer);
register_gdbarch_init (bfd_arch_microblaze, microblaze_gdbarch_init);
/* Debug this files internals. */
register_gdbarch_init (bfd_arch_microblaze, microblaze_gdbarch_init);
/* Debug this files internals. */
- add_setshow_zinteger_cmd ("microblaze", class_maintenance,
- µblaze_debug_flag, _("\
+ add_setshow_zuinteger_cmd ("microblaze", class_maintenance,
+ µblaze_debug_flag, _("\
Set microblaze debugging."), _("\
Show microblaze debugging."), _("\
When non-zero, microblaze specific debugging is enabled."),
Set microblaze debugging."), _("\
Show microblaze debugging."), _("\
When non-zero, microblaze specific debugging is enabled."),