Use all_non_exited_inferiors in infrun.c
[deliverable/binutils-gdb.git] / gdb / infcmd.c
index dc82ef043fe85deaef3419e7171e6148af06f977..99823a8f2589169bc72760123ad01b9e39389bd8 100644 (file)
@@ -1,6 +1,6 @@
 /* Memory-access and commands for "inferior" process, for GDB.
 
-   Copyright (C) 1986-2019 Free Software Foundation, Inc.
+   Copyright (C) 1986-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -19,7 +19,6 @@
 
 #include "defs.h"
 #include "arch-utils.h"
-#include <signal.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "frame.h"
@@ -35,8 +34,6 @@
 #include "objfiles.h"
 #include "completer.h"
 #include "ui-out.h"
-#include "event-top.h"
-#include "parser-defs.h"
 #include "regcache.h"
 #include "reggroups.h"
 #include "block.h"
@@ -45,7 +42,6 @@
 #include "observable.h"
 #include "target-descriptions.h"
 #include "user-regs.h"
-#include "cli/cli-decode.h"
 #include "gdbthread.h"
 #include "valprint.h"
 #include "inline-frame.h"
 #include "inf-loop.h"
 #include "continuations.h"
 #include "linespec.h"
-#include "cli/cli-utils.h"
-#include "infcall.h"
 #include "thread-fsm.h"
 #include "top.h"
 #include "interps.h"
+#include "skip.h"
 #include "gdbsupport/gdb_optional.h"
 #include "source.h"
+#include "cli/cli-style.h"
 
 /* Local functions: */
 
@@ -103,10 +99,6 @@ enum stop_stack_kind stop_stack_dummy;
 
 int stopped_by_random_signal;
 
-/* See inferior.h.  */
-
-bool startup_with_shell = true;
-
 \f
 /* Accessor routines.  */
 
@@ -859,9 +851,8 @@ continue_command (const char *args, int from_tty)
       else
        {
          ptid_t last_ptid;
-         struct target_waitstatus ws;
 
-         get_last_target_status (&last_ptid, &ws);
+         get_last_target_status (&last_ptid, nullptr);
          tp = find_thread_ptid (last_ptid);
        }
       if (tp != NULL)
@@ -1115,14 +1106,29 @@ prepare_one_step (struct step_command_fsm *sm)
              && inline_skipped_frames (tp))
            {
              ptid_t resume_ptid;
+             const char *fn = NULL;
+             symtab_and_line sal;
+             struct symbol *sym;
 
              /* Pretend that we've ran.  */
              resume_ptid = user_visible_resume_ptid (1);
              set_running (resume_ptid, 1);
 
              step_into_inline_frame (tp);
-             sm->count--;
-             return prepare_one_step (sm);
+
+             frame = get_current_frame ();
+             sal = find_frame_sal (frame);
+             sym = get_frame_function (frame);
+
+             if (sym != NULL)
+               fn = sym->print_name ();
+
+             if (sal.line == 0
+                 || !function_name_is_marked_for_skip (fn, sal))
+               {
+                 sm->count--;
+                 return prepare_one_step (sm);
+               }
            }
 
          pc = get_frame_pc (frame);
@@ -1219,7 +1225,7 @@ jump_command (const char *arg, int from_tty)
   if (fn != NULL && sfn != fn)
     {
       if (!query (_("Line %d is not in `%s'.  Jump anyway? "), sal.line,
-                 SYMBOL_PRINT_NAME (fn)))
+                 fn->print_name ()))
        {
          error (_("Not confirmed."));
          /* NOTREACHED */
@@ -1628,7 +1634,8 @@ print_return_value_1 (struct ui_out *uiout, struct return_value_info *rv)
          uiout->field_stream ("return-value", stb);
        }
       else
-       uiout->field_string ("return-value", _("<not displayed>"));
+       uiout->field_string ("return-value", _("<not displayed>"),
+                            metadata_style.style ());
       uiout->text ("\n");
     }
   else
@@ -1947,7 +1954,7 @@ finish_command (const char *arg, int from_tty)
          if (sm->function != NULL && TYPE_NO_RETURN (sm->function->type)
              && !query (_("warning: Function %s does not return normally.\n"
                           "Try to finish anyway? "),
-                        SYMBOL_PRINT_NAME (sm->function)))
+                        sm->function->print_name ()))
            error (_("Not confirmed."));
          printf_filtered (_("Run till exit from "));
        }
@@ -1985,11 +1992,7 @@ info_program_command (const char *args, int from_tty)
   if (non_stop)
     ptid = inferior_ptid;
   else
-    {
-      struct target_waitstatus ws;
-
-      get_last_target_status (&ptid, &ws);
-    }
+    get_last_target_status (&ptid, nullptr);
 
   if (ptid == null_ptid || ptid == minus_one_ptid)
     error (_("No selected thread."));
@@ -2081,7 +2084,7 @@ set_environment_command (const char *arg, int from_tty)
   if (arg == 0)
     error_no_arg (_("environment variable and value"));
 
-  /* Find seperation between variable name and value.  */
+  /* Find separation between variable name and value.  */
   p = (char *) strchr (arg, '=');
   val = (char *) strchr (arg, ' ');
 
@@ -2224,7 +2227,7 @@ default_print_one_register_info (struct ui_file *file,
     {
       struct value_print_options opts;
       const gdb_byte *valaddr = value_contents_for_printing (val);
-      enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (regtype));
+      enum bfd_endian byte_order = type_byte_order (regtype);
 
       get_user_print_options (&opts);
       opts.deref_ref = 1;
@@ -2503,20 +2506,6 @@ kill_command (const char *arg, int from_tty)
     printf_unfiltered (_("[Inferior %d (%s) killed]\n"),
                       infnum, pid_str.c_str ());
 
-  /* If we still have other inferiors to debug, then don't mess with
-     with their threads.  */
-  if (!have_inferiors ())
-    {
-      init_thread_list ();             /* Destroy thread info.  */
-
-      /* Killing off the inferior can leave us with a core file.  If
-        so, print the state we are left in.  */
-      if (target_has_stack)
-       {
-         printf_filtered (_("In %s,\n"), target_longname);
-         print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
-       }
-    }
   bfd_cache_close_all ();
 }
 
@@ -3028,7 +3017,7 @@ info_proc_cmd_1 (const char *args, enum info_proc_what what, int from_tty)
     }
 }
 
-/* Implement `info proc' when given without any futher parameters.  */
+/* Implement `info proc' when given without any further parameters.  */
 
 static void
 info_proc_cmd (const char *args, int from_tty)
This page took 0.032998 seconds and 4 git commands to generate.