frame, cfa: check unwind stop reason first
authorMarkus Metzger <markus.t.metzger@intel.com>
Mon, 18 Mar 2013 15:43:05 +0000 (16:43 +0100)
committerMarkus Metzger <markus.t.metzger@intel.com>
Thu, 16 Jan 2014 12:06:11 +0000 (13:06 +0100)
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/ChangeLog
gdb/dwarf2-frame.c

index a81516b90033217b3bb4e4e5a431df924b000c3a..077d059d9b836307e1bb6eb9144872787f09f781 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-16  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * dwarf2-frame.c (dwarf2_frame_cfa): Move UNWIND_UNAVAILABLE check
+       earlier.
+
 2014-01-16  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * frame-unwind.c: Include target.h.
index d6d1bf75c4d40533092616888e314ef5400ea719..772de56b4d1059c790e6897a94b5874fd073f24b 100644 (file)
@@ -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);
 }
 \f
This page took 0.032052 seconds and 4 git commands to generate.