stack: check frame_unwind_caller_id
[deliverable/binutils-gdb.git] / gdb / stack.c
index 89879f38adbf66db738fed1d34caa04eb8c626fb..6e3acc7e40288996c8087609818c1df5c743be67 100644 (file)
@@ -1509,27 +1509,32 @@ frame_info (char *addr_exp, int from_tty)
   wrap_here ("    ");
   printf_filtered ("saved %s = ", pc_regname);
 
-  TRY
-    {
-      caller_pc = frame_unwind_caller_pc (fi);
-      caller_pc_p = 1;
-    }
-  CATCH (ex, RETURN_MASK_ERROR)
+  if (!frame_id_p (frame_unwind_caller_id (fi)))
+    val_print_unavailable (gdb_stdout);
+  else
     {
-      switch (ex.error)
+      TRY
        {
-       case NOT_AVAILABLE_ERROR:
-         val_print_unavailable (gdb_stdout);
-         break;
-       case OPTIMIZED_OUT_ERROR:
-         val_print_not_saved (gdb_stdout);
-         break;
-       default:
-         fprintf_filtered (gdb_stdout, _("<error: %s>"), ex.message);
-         break;
+         caller_pc = frame_unwind_caller_pc (fi);
+         caller_pc_p = 1;
        }
+      CATCH (ex, RETURN_MASK_ERROR)
+       {
+         switch (ex.error)
+           {
+           case NOT_AVAILABLE_ERROR:
+             val_print_unavailable (gdb_stdout);
+             break;
+           case OPTIMIZED_OUT_ERROR:
+             val_print_not_saved (gdb_stdout);
+             break;
+           default:
+             fprintf_filtered (gdb_stdout, _("<error: %s>"), ex.message);
+             break;
+           }
+       }
+      END_CATCH
     }
-  END_CATCH
 
   if (caller_pc_p)
     fputs_filtered (paddress (gdbarch, caller_pc), gdb_stdout);
This page took 0.02513 seconds and 4 git commands to generate.