gdb: include gdbsupport/buildargv.h in ser-mingw.c
[binutils-gdb.git] / gdb / infcmd.c
index d00a70c4361d26c106c3604d28c23843a4a6175a..9f4ed8bff1383476e0dfdb65d65064de8de769eb 100644 (file)
@@ -1,6 +1,6 @@
 /* Memory-access and commands for "inferior" process, for GDB.
 
-   Copyright (C) 1986-2021 Free Software Foundation, Inc.
+   Copyright (C) 1986-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -2349,12 +2349,11 @@ kill_command (const char *arg, int from_tty)
   int infnum = current_inferior ()->num;
 
   target_kill ();
+  bfd_cache_close_all ();
 
   if (print_inferior_events)
-    printf_unfiltered (_("[Inferior %d (%s) killed]\n"),
-                      infnum, pid_str.c_str ());
-
-  bfd_cache_close_all ();
+    printf_filtered (_("[Inferior %d (%s) killed]\n"),
+                    infnum, pid_str.c_str ());
 }
 
 /* Used in `attach&' command.  Proceed threads of inferior INF iff
@@ -2542,6 +2541,18 @@ attach_command (const char *args, int from_tty)
      shouldn't refer to attach_target again.  */
   attach_target = NULL;
 
+  if (debug_infrun)
+    {
+      infrun_debug_printf ("immediately after attach:");
+      for (thread_info *thread : inferior->non_exited_threads ())
+       infrun_debug_printf ("  thread %s, executing = %d, resumed = %d, "
+                            "state = %s",
+                            thread->ptid.to_string ().c_str (),
+                            thread->executing (),
+                            thread->resumed (),
+                            thread_state_string (thread->state));
+    }
+
   /* Set up the "saved terminal modes" of the inferior
      based on what modes we are starting it with.  */
   target_terminal::init ();