From: Markus Metzger Date: Mon, 18 Mar 2013 15:43:05 +0000 (+0100) Subject: frame, cfa: check unwind stop reason first X-Git-Tag: gdb-7.8-release~1567 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32261e523447cdecdfffe93807ac9bd0de3fe88d;p=external%2Fbinutils.git frame, cfa: check unwind stop reason first 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 * dwarf2-frame.c (dwarf2_frame_cfa): Move UNWIND_UNAVAILABLE check earlier. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a81516b..077d059 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2014-01-16 Jan Kratochvil + * dwarf2-frame.c (dwarf2_frame_cfa): Move UNWIND_UNAVAILABLE check + earlier. + +2014-01-16 Jan Kratochvil + * frame-unwind.c: Include target.h. (frame_unwind_try_unwinder): New function with code from ... (frame_unwind_find_by_frame): ... here. New variable diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index d6d1bf7..772de56 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); }