#define IS_SUB2_SP(x) (x==0x1b87)
#define IS_MOVK_R5(x) (x==0x7905)
#define IS_SUB_R5SP(x) (x==0x1957)
-CORE_ADDR examine_prologue ();
+
+static CORE_ADDR examine_prologue ();
void frame_find_saved_regs ();
CORE_ADDR
h8300_skip_prologue (start_pc)
CORE_ADDR start_pc;
-
{
short int w;
}
return start_pc;
-
}
int
{
disassemble_info info;
GDB_INIT_DISASSEMBLE_INFO(info, stream);
- return print_insn_h8300 (memaddr, &info);
+ if (HMODE)
+ return print_insn_h8300h (memaddr, &info);
+ else
+ return print_insn_h8300 (memaddr, &info);
}
/* Given a GDB frame, determine the address of the calling function's frame.
FRAME_CHAIN (thisframe)
FRAME thisframe;
{
-
frame_find_saved_regs (thisframe, (struct frame_saved_regs *) 0);
return thisframe->fsr->regs[SP_REGNUM];
}
NEXT_PROLOGUE_INSN (addr, lim, pword1)
CORE_ADDR addr;
CORE_ADDR lim;
- short *pword1;
+ INSN_WORD *pword1;
{
+ char buf[2];
if (addr < lim + 8)
{
- read_memory (addr, pword1, sizeof (*pword1));
- SWAP_TARGET_AND_HOST (pword1, sizeof (short));
+ read_memory (addr, buf, 2);
+ *pword1 = extract_signed_integer (buf, 2);
return addr + 2;
}
int r;
int i;
int have_fp = 0;
-
register int src;
register struct pic_prologue_code *pcode;
INSN_WORD insn_word;
int size, offset;
- unsigned int reg_save_depth = 2; /* Number of things pushed onto
- stack, starts at 2, 'cause the
- PC is already there */
+ /* Number of things pushed onto stack, starts at 2/4, 'cause the
+ PC is already there */
+ unsigned int reg_save_depth = HMODE ? 4 : 2;
unsigned int auto_depth = 0; /* Number of bytes of autos */
{
after_prolog_fp = read_register (SP_REGNUM);
}
- if (ip == 0 || ip & ~0xffff)
+ if (ip == 0 || ip & (HMODE ? ~0xffff : ~0xffff))
return 0;
next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn_word);
next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn_word);
auto_depth += insn_word;
-
}
}
/* Work out which regs are stored where */
fi->args_pointer = 0; /* Unknown */
fi->locals_pointer = 0; /* Unknown */
fi->from_pc = 0;
-
}
/* Return the saved PC from this frame.
CORE_ADDR
frame_saved_pc (frame)
FRAME frame;
-
{
return frame->from_pc;
}
flush_cached_frames ();
set_current_frame (create_new_frame (read_register (FP_REGNUM),
read_pc ()));
-
}
-
}
void