This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v9 17/29] frame, cfa: check unwind stop reason first
- From: Markus Metzger <markus dot t dot metzger at intel dot com>
- To: jan dot kratochvil at redhat dot com, palves at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 19 Dec 2013 17:44:47 +0100
- Subject: [PATCH v9 17/29] frame, cfa: check unwind stop reason first
- Authentication-results: sourceware.org; auth=none
- References: <1387471499-29444-1-git-send-email-markus dot t dot metzger at intel dot com>
Swap the unwind stop reason check and the unwinder check to allow
non-dwarf2 frame types to fail with a recoverable error.
gdb/
2013-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2-frame.c (dwarf2_frame_cfa): Move UNWIND_UNAVAILABLE check
earlier.
---
gdb/dwarf2-frame.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 91b2120..adad2dc 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -1512,16 +1512,16 @@ dwarf2_frame_cfa (struct frame_info *this_frame)
{
while (get_frame_type (this_frame) == INLINE_FRAME)
this_frame = get_prev_frame (this_frame);
+ if (get_frame_unwind_stop_reason (this_frame) == UNWIND_UNAVAILABLE)
+ throw_error (NOT_AVAILABLE_ERROR,
+ _("can't compute CFA for this frame: "
+ "required registers or memory are unavailable"));
/* This restriction could be lifted if other unwinders are known to
compute the frame base in a way compatible with the DWARF
unwinder. */
if (!frame_unwinder_is (this_frame, &dwarf2_frame_unwind)
&& !frame_unwinder_is (this_frame, &dwarf2_tailcall_frame_unwind))
error (_("can't compute CFA for this frame"));
- if (get_frame_unwind_stop_reason (this_frame) == UNWIND_UNAVAILABLE)
- throw_error (NOT_AVAILABLE_ERROR,
- _("can't compute CFA for this frame: "
- "required registers or memory are unavailable"));
return get_frame_base (this_frame);
}
--
1.8.3.1