* infcmd.c (print_vector_info, print_float_info): Move code that
[deliverable/binutils-gdb.git] / gdb / infcmd.c
index 15efbe1937a560ab417e9de3971b189ca0fb5e26..2556221f29d1d400c14ca9a0bf92340bd2a69e8c 100644 (file)
@@ -1791,6 +1791,11 @@ 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 (selected_frame == NULL)
+    error ("No selected frame.");
+
   if (gdbarch_print_vector_info_p (gdbarch))
     gdbarch_print_vector_info (gdbarch, file, frame, args);
   else
@@ -1798,11 +1803,6 @@ print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
       int regnum;
       int printed_something = 0;
 
-      if (!target_has_registers)
-       error ("The program has no registers now.");
-      if (selected_frame == NULL)
-       error ("No selected frame.");
-
       for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
        {
          if (gdbarch_register_reggroup_p (gdbarch, regnum, vector_reggroup))
@@ -1958,6 +1958,11 @@ 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 (selected_frame == NULL)
+    error ("No selected frame.");
+
   if (gdbarch_print_float_info_p (gdbarch))
     gdbarch_print_float_info (gdbarch, file, frame, args);
   else
@@ -1971,11 +1976,6 @@ print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
       int regnum;
       int printed_something = 0;
 
-      if (!target_has_registers)
-       error ("The program has no registers now.");
-      if (selected_frame == NULL)
-       error ("No selected frame.");
-
       for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
        {
          if (gdbarch_register_reggroup_p (gdbarch, regnum, float_reggroup))
This page took 0.023207 seconds and 4 git commands to generate.