This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2 2/3] frame: use get_prev_frame_always in skip_tailcall_frames
- From: Markus Metzger <markus dot t dot metzger at intel dot com>
- To: palves at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 5 Feb 2016 15:18:41 +0100
- Subject: [PATCH v2 2/3] frame: use get_prev_frame_always in skip_tailcall_frames
- Authentication-results: sourceware.org; auth=none
- References: <1454681922-2228-1-git-send-email-markus dot t dot metzger at intel dot com>
Following the practice in skip_artificial_frames, also use get_prev_frame_always
instead of get_prev_frame in skip_tailcall_frames.
2016-02-05 Markus Metzger <markus.t.metzger@intel.com>
gdb/
* frame.c (skip_tailcall_frames): Call get_prev_frame_always.
---
gdb/frame.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/frame.c b/gdb/frame.c
index b7832c7..6ab8834 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -443,8 +443,12 @@ skip_artificial_frames (struct frame_info *frame)
struct frame_info *
skip_tailcall_frames (struct frame_info *frame)
{
+ /* Note we use get_prev_frame_always, and not get_prev_frame. The
+ latter will truncate the frame chain, leading to this function
+ unintentionally returning a null_frame_id (e.g., when the user
+ sets a backtrace limit). */
while (get_frame_type (frame) == TAILCALL_FRAME)
- frame = get_prev_frame (frame);
+ frame = get_prev_frame_always (frame);
return frame;
}
--
1.8.3.1