* frame.c (deprecated_selected_frame): Rename to...
[deliverable/binutils-gdb.git] / gdb / infcmd.c
index c47326ffd4306c24b4cd0ca700b86d8e72581d71..f3a61f25be046eb9f894175b34201322d4591332 100644 (file)
@@ -1295,10 +1295,8 @@ finish_command (char *arg, int from_tty)
     error (_("The \"finish\" command does not take any arguments."));
   if (!target_has_execution)
     error (_("The program is not running."));
-  if (deprecated_selected_frame == NULL)
-    error (_("No selected frame."));
 
-  frame = get_prev_frame (deprecated_selected_frame);
+  frame = get_prev_frame (get_selected_frame (_("No selected frame.")));
   if (frame == 0)
     error (_("\"finish\" not meaningful in the outermost frame."));
 
@@ -1316,7 +1314,7 @@ finish_command (char *arg, int from_tty)
 
   /* Find the function we will return from.  */
 
-  function = find_pc_function (get_frame_pc (deprecated_selected_frame));
+  function = find_pc_function (get_frame_pc (get_selected_frame (NULL)));
 
   /* Print info on the selected frame, including level number but not
      source.  */
@@ -1677,18 +1675,18 @@ default_print_registers_info (struct gdbarch *gdbarch,
 void
 registers_info (char *addr_exp, int fpregs)
 {
+  struct frame_info *frame;
   int regnum, numregs;
   char *end;
 
   if (!target_has_registers)
     error (_("The program has no registers now."));
-  if (deprecated_selected_frame == NULL)
-    error (_("No selected frame."));
+  frame = get_selected_frame (NULL);
 
   if (!addr_exp)
     {
       gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
-                                   deprecated_selected_frame, -1, fpregs);
+                                   frame, -1, fpregs);
       return;
     }
 
@@ -1721,12 +1719,12 @@ registers_info (char *addr_exp, int fpregs)
 
       /* A register name?  */
       {
-       int regnum = frame_map_name_to_regnum (deprecated_selected_frame,
+       int regnum = frame_map_name_to_regnum (frame,
                                               start, end - start);
        if (regnum >= 0)
          {
            gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
-                                         deprecated_selected_frame, regnum, fpregs);
+                                         frame, regnum, fpregs);
            continue;
          }
       }
@@ -1740,7 +1738,7 @@ registers_info (char *addr_exp, int fpregs)
            && regnum < NUM_REGS + NUM_PSEUDO_REGS)
          {
            gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
-                                         deprecated_selected_frame, regnum, fpregs);
+                                         frame, regnum, fpregs);
            continue;
          }
       }
@@ -1766,7 +1764,7 @@ registers_info (char *addr_exp, int fpregs)
                if (gdbarch_register_reggroup_p (current_gdbarch, regnum,
                                                 group))
                  gdbarch_print_registers_info (current_gdbarch,
-                                               gdb_stdout, deprecated_selected_frame,
+                                               gdb_stdout, frame,
                                                regnum, fpregs);
              }
            continue;
@@ -1794,11 +1792,6 @@ static void
 print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
                   struct frame_info *frame, const char *args)
 {
-  if (!target_has_registers)
-    error (_("The program has no registers now."));
-  if (deprecated_selected_frame == NULL)
-    error (_("No selected frame."));
-
   if (gdbarch_print_vector_info_p (gdbarch))
     gdbarch_print_vector_info (gdbarch, file, frame, args);
   else
@@ -1822,7 +1815,11 @@ print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
 static void
 vector_info (char *args, int from_tty)
 {
-  print_vector_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, args);
+  if (!target_has_registers)
+    error (_("The program has no registers now."));
+
+  print_vector_info (current_gdbarch, gdb_stdout,
+                    get_selected_frame (NULL), args);
 }
 \f
 
@@ -2012,11 +2009,6 @@ static void
 print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
                  struct frame_info *frame, const char *args)
 {
-  if (!target_has_registers)
-    error (_("The program has no registers now."));
-  if (deprecated_selected_frame == NULL)
-    error (_("No selected frame."));
-
   if (gdbarch_print_float_info_p (gdbarch))
     gdbarch_print_float_info (gdbarch, file, frame, args);
   else
@@ -2041,8 +2033,11 @@ No floating-point info available for this processor.\n");
 static void
 float_info (char *args, int from_tty)
 {
+  if (!target_has_registers)
+    error (_("The program has no registers now."));
+
   print_float_info (current_gdbarch, gdb_stdout, 
-                   deprecated_selected_frame, args);
+                   get_selected_frame (NULL), args);
 }
 \f
 static void
This page took 0.043758 seconds and 4 git commands to generate.