-/* Function: xstormy16_init_extra_frame_info
- This is the constructor function for the frame_info struct,
- called whenever a new frame_info is created (from create_new_frame,
- and from get_prev_frame).
-*/
-
-static void
-xstormy16_init_extra_frame_info (int fromleaf, struct frame_info *fi)
-{
- if (!get_frame_extra_info (fi))
- {
- frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
- get_frame_extra_info (fi)->framesize = 0;
- get_frame_extra_info (fi)->frameless_p = 1; /* Default frameless, detect framed */
-
- /* By default, the fi->frame is set to the value of the FP reg by gdb.
- This may not always be right; we may be in a frameless function,
- or we may be in the prologue, before the FP has been set up.
- Unfortunately, we can't make this determination without first
- calling scan_prologue, and we can't do that unles we know the
- get_frame_pc (fi). */
-
- if (!get_frame_pc (fi))
- {
- /* Sometimes we are called from get_prev_frame without
- the PC being set up first. Long history, don't ask.
- Fortunately this will never happen from the outermost
- frame, so we should be able to get the saved pc from
- the next frame. */
- if (get_next_frame (fi))
- deprecated_update_frame_pc_hack (fi, xstormy16_frame_saved_pc (get_next_frame (fi)));
- }
-
- /* Take care of the saved_regs right here (non-lazy). */
- xstormy16_frame_init_saved_regs (fi);
- }
-}
-
-/* Function: xstormy16_frame_chain
- Returns a pointer to the stack frame of the calling function.
- Called only from get_prev_frame. Needed for backtrace, "up", etc.
-*/
-
-static CORE_ADDR
-xstormy16_frame_chain (struct frame_info *fi)
-{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
- {
- /* Call dummy's frame is the same as caller's. */
- return get_frame_base (fi);
- }
- else
- {
- /* Return computed offset from this frame's fp. */
- return get_frame_base (fi) - get_frame_extra_info (fi)->framesize;
- }
-}
-
-static int
-xstormy16_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
-{
- return chain < 0x8000 && DEPRECATED_FRAME_SAVED_PC (thisframe) >= 0x8000 &&
- (get_frame_extra_info (thisframe)->frameless_p ||
- get_frame_base (thisframe) - get_frame_extra_info (thisframe)->framesize == chain);
-}
-
-/* Function: xstormy16_saved_pc_after_call Returns the previous PC
- immediately after a function call. This function is meant to
- bypass the regular frame_register() mechanism, ie. it is meant to
- work even if the frame isn't complete. Called by
- step_over_function, and sometimes by get_prev_frame. */
-
-static CORE_ADDR
-xstormy16_saved_pc_after_call (struct frame_info *ignore)
-{
- CORE_ADDR sp, pc, tmp;
-
- sp = read_register (E_SP_REGNUM) - xstormy16_pc_size;
- pc = read_memory_integer (sp, xstormy16_pc_size);
-
- /* Skip over jump table entry if necessary. */
- if ((tmp = SKIP_TRAMPOLINE_CODE (pc)))
- pc = tmp;
-
- return pc;
-}
-
-const static unsigned char *
-xstormy16_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
-{
- static unsigned char breakpoint[] = { 0x06, 0x0 };
- *lenptr = sizeof (breakpoint);
- return breakpoint;
-}