* target.h (struct target_ops): Make to_has_all_memory,
[deliverable/binutils-gdb.git] / gdb / top.c
index 7a10f7c647721d01fd5037b30c6aa9765fe58621..de494189f18c16a44744f443b0d2008cf89b7897 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1222,10 +1222,15 @@ kill_or_detach (struct inferior *inf, void *args)
   if (thread)
     {
       switch_to_thread (thread->ptid);
-      if (inf->attach_flag)
-       target_detach (qt->args, qt->from_tty);
-      else
-       target_kill ();
+
+      /* Leave core files alone.  */
+      if (target_has_execution)
+       {
+         if (inf->attach_flag)
+           target_detach (qt->args, qt->from_tty);
+         else
+           target_kill ();
+       }
     }
 
   return 0;
@@ -1239,8 +1244,7 @@ quit_target (void *arg)
   struct qt_args *qt = (struct qt_args *)arg;
 
   /* Kill or detach all inferiors.  */
-  if (target_has_execution)
-    iterate_over_inferiors (kill_or_detach, qt);
+  iterate_over_inferiors (kill_or_detach, qt);
 
   /* Give all pushed targets a chance to do minimal cleanup, and pop
      them all out.  */
This page took 0.034176 seconds and 4 git commands to generate.