btrace: temporarily set inferior_ptid in record_btrace_start_replaying
[deliverable/binutils-gdb.git] / gdb / inferior.c
index 5e98df58942a005c3d066e3742e75a2940e41fa5..04e9a286d5681c7c5d8d24215a20b1af490b054d 100644 (file)
@@ -128,7 +128,7 @@ add_inferior_silent (int pid)
 {
   struct inferior *inf;
 
-  inf = xmalloc (sizeof (*inf));
+  inf = XNEW (struct inferior);
   memset (inf, 0, sizeof (*inf));
   inf->pid = pid;
 
@@ -625,6 +625,11 @@ detach_inferior_command (char *args, int from_tty)
        }
 
       pid = gdb_inferior_id_to_pid (num);
+      if (pid == 0)
+       {
+         warning (_("Inferior ID %d is not running."), num);
+         continue;
+       }
 
       tp = any_thread_of_process (pid);
       if (!tp)
@@ -661,6 +666,11 @@ kill_inferior_command (char *args, int from_tty)
        }
 
       pid = gdb_inferior_id_to_pid (num);
+      if (pid == 0)
+       {
+         warning (_("Inferior ID %d is not running."), num);
+         continue;
+       }
 
       tp = any_thread_of_process (pid);
       if (!tp)
This page took 0.023649 seconds and 4 git commands to generate.