]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2004-07-26 Andrew Cagney <cagney@gnu.org>
authorAndrew Cagney <cagney@redhat.com>
Mon, 26 Jul 2004 19:01:36 +0000 (19:01 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 26 Jul 2004 19:01:36 +0000 (19:01 +0000)
Problem reported by Ashley Pittman <ashley@quadrics.com>.
* main.c (captured_main): When in batch mode always detach.

gdb/main.c

index 4e5fd2a02f54ca0121cdf8181378a65dd8126151..0042962c5dcf33fa85d7f752d4767df92c33f3d7 100644 (file)
@@ -729,6 +729,13 @@ extern int gdbtk_test (char *);
 
   if (batch)
     {
+      if (attach_flag)
+       /* Either there was a problem executing the command in the
+          batch file aborted early, or the batch file forgot to do an
+          explicit detach.  Explicitly detach the inferior ensuring
+          that there are no zombies.  */
+       target_detach (NULL, 0);
+      
       /* We have hit the end of the batch file.  */
       exit (0);
     }