* h8300-tdep.c (h8300_push_dummy_call): Replace unsafe alloca
[deliverable/binutils-gdb.git] / gdb / f-valprint.c
index 8b84b5aff6642028f4b2666939c51a1095b467d5..4359f6f62e9b4a45325f054e888a50aaeebbeea8 100644 (file)
@@ -505,6 +505,8 @@ info_common_command (char *comname, int from_tty)
 
   if (the_common)
     {
+      struct frame_id frame_id = get_frame_id (fi);
+
       if (strcmp (comname, BLANK_COMMON_NAME_LOCAL) == 0)
        printf_filtered (_("Contents of blank COMMON block:\n"));
       else
@@ -515,7 +517,18 @@ info_common_command (char *comname, int from_tty)
 
       while (entry != NULL)
        {
+         fi = frame_find_by_id (frame_id);
+         if (fi == NULL)
+           {
+             warning (_("Unable to restore previously selected frame."));
+             break;
+           }
+
          print_variable_and_value (NULL, entry->symbol, fi, gdb_stdout, 0);
+
+         /* print_variable_and_value invalidates FI.  */
+         fi = NULL;
+
          entry = entry->next;
        }
     }
This page took 0.024182 seconds and 4 git commands to generate.