Add a new function skip_tailcall_frames to skip TAILCALL_FRAME frames.
gdb/
* frame.h (skip_tailcall_frames): New.
* frame.c (skip_tailcall_frames): New.
(frame_pop): Call skip_tailcall_frames.
* infcmd.c (finish_command): Call skip_tailcall_frames.
+2016-02-12 Markus Metzger <markus.t.metzger@intel.com>
+
+ * frame.h (skip_tailcall_frames): New.
+ * frame.c (skip_tailcall_frames): New.
+ (frame_pop): Call skip_tailcall_frames.
+ * infcmd.c (finish_command): Call skip_tailcall_frames.
+
2016-02-11 Pedro Alves <palves@redhat.com>
* Makefile.in (check-parallel): New rule.
return frame;
}
+/* See frame.h. */
+
+struct frame_info *
+skip_tailcall_frames (struct frame_info *frame)
+{
+ while (get_frame_type (frame) == TAILCALL_FRAME)
+ frame = get_prev_frame (frame);
+
+ return frame;
+}
+
/* Compute the frame's uniq ID that can be used to, later, re-find the
frame. */
/* Ignore TAILCALL_FRAME type frames, they were executed already before
entering THISFRAME. */
- while (get_frame_type (prev_frame) == TAILCALL_FRAME)
- prev_frame = get_prev_frame (prev_frame);
+ prev_frame = skip_tailcall_frames (prev_frame);
/* Make a copy of all the register values unwound from this frame.
Save them in a scratch buffer so that there isn't a race between
extern enum language get_frame_language (struct frame_info *frame);
+/* Return the first non-tailcall frame above FRAME or FRAME if it is not a
+ tailcall frame. */
+
+extern struct frame_info *skip_tailcall_frames (struct frame_info *frame);
#endif /* !defined (FRAME_H) */
/* Ignore TAILCALL_FRAME type frames, they were executed already before
entering THISFRAME. */
- while (get_frame_type (frame) == TAILCALL_FRAME)
- frame = get_prev_frame (frame);
+ frame = skip_tailcall_frames (frame);
/* Find the function we will return from. */